All possible solutions for $x_1+x_2+x_3=25$ with conditions for $x_1, x_2$ and $x_3$ ranges Find all possible solutions for $x_1+x_2+x_3=25$. Numbers have to fulfill the following conditions: $0 \leq x_1 \leq 5,  2 < x_2 \leq 10$ and $5 \leq x_3 \leq 15$. Solutions $(a,b,c)$ and $(b,a,c)$ are considered different. $x_1, x_2$ and $x_3$ are natural numbers.
I've tried it this way: I put $x_1$ as fixed $(0)$ then I put $x_2$ as fixed $(3)$ now I have $25-3=22$ which means that no matter what I put as $x_3$ I cannot get $22$. So, I see that $x_2$ can be min $(22-15-0=7)$ therefore I see that when $x_1=0, x_2$ can be min $7$ so the number of possible combinations for $x_1=0$ is $4$. Going up by one from $x_1 = 0 .. 5$, I can also increase number of $x_2$ that fits so all together there are $4+5+6+7+8+9= 39$ combinations. I've done the same for the $x_2$ and $x_3$: Fix one of them and calculate the number of possibilities, but apparently the number that I get is incorrect. I do not have the correct number to check whether I'm just making a numerical mistake or whether my logic is flawed. Any help is appreciated.
EDIT: $x_1, x_2$ and $x_3$ are natural numbers.
 A: The standard way to solve such problems is to use generating functions.
We "encode" the conditions as coefficients of polynomials, so $0 \le x_1 \le 5$, becomes $(1+x+x^2+x^3+x^4+x^5)$ ,$2 < x_2 \le 10$ becomes $(x^3 + x^4 + x^5 +x^6+ x^7+ x^8+x^9 + x^{10})$, while the final condition becomes $5 \le x_3 \le 15$ becomes $(x^5 +x^6 + \ldots x^{14} + x^{15})$. If we multiply these 3 together and look at the coefficinet of $x^{25}$, we see that we get a sum of $1$'s, one for each combination of choices of $x^i$ from these 3 polynomials: solution $(a,b,c)$ corresponds to the product of $x^a$ from the first, $x^b$ from the second and $x^c$ from the last polynomial. This contributes $1$ to the coefficient of $x^{21}$ precisely when $a+b+c= 25$.
This coefficient can be lazily obtained by using a computer algebra solution, e.g. wolfram alpha and read off the coefficient (here $21$).
It's also possible to do it purely analytically, using binomial formulas and geometric series; there are plenty of examples on this site alone.
A: With $x_1=0$ there is $1$ possibility. ( $(x_2,x_3)=(10,15)$)
With $x_1=1$ there are $2$ possibility. 
With $x_1=2$ there are $3$ possibility. 
With $x_1=3$ there are $4$ possibility. 
With $x_1=4$ there are $5$ possibility. 
With $x_1=5$ there are $6$ possibility. 
So there are $\color{blue}{21}$ possibilities in toto.
A: i would start with $$0\le x_1\le 5$$ then you will get
$$x_1=0$$
$$x_2=1$$
$$x_3=2$$
$$x_4=3$$
$$x_5=4$$
$$x_6=5$$
then you have only to solve $$x_2+x_3=25-x_1$$ for each case and so on
