# |x|+|y|+|z|=15. How many integer solutions do exist?

I tried to truncate the problem to $|x|+|y|=15$, which is giving me the answer to be $60$ solutions. However, I am trying to apply beggar method and everything shatters. How should I proceed? Can I apply beggar method here? Is the answer somewhat related to distributing $15$ mangoes between $3$ people?

-
Did you mean $|x|$? – TZakrevskiy May 28 '14 at 8:36
Since $|z|\leq 15$, you can count solutions to $|x|+|y|=i$ for $i=0,\ldots,15$ and add them up (paying attention to signs). – Ferra May 28 '14 at 8:48
Yes, I mean |x|. – Sherlock Watson May 28 '14 at 8:52
Is the beggar method same as stars and bars? – shaurya gupta May 28 '14 at 9:24

We have three cases:
Case I: $x,y,z\ne0$
There are ${15-1\choose 3-1}$ ways to distribute the $15$. But since $x,y,z$ can be negative, we have $2^3$ ways to distribute the negative sign. So this gives us a total of $8\cdot{15-1\choose 3-1}$ ways.
Case II: Only one out of $x,y,z$ is $0$.
There are three ways to make any one of $x,y,z$ equal to $0$. For example, let $x=0$. Now we need to distribute the 15 between $y,z$. This can be done in ${15-1\choose2-1}$. Now we can also make any of $y,z$negative. This can be done in $2^2$ ways. So we get a total of $2^2\cdot3\cdot{15-1\choose2-1}$ ways.
Case III: Two out of $x,y,z$ are $0$.
The zeroes can be distributed in $3$ ways. Let us say $x,y=0$. Now $z$ can be $15,-15$. So we have 6 ways to do this.
Adding 'em up, we get a total of $728+168+6=\boxed{902}$ ways.

-
Thanks Shaurya, this is wonderfully explained. – Sherlock Watson May 28 '14 at 14:49
@SherlockWatson You're welcome :) – shaurya gupta May 28 '14 at 16:16
@SherlockWatson Where did you get this question from? – shaurya gupta May 28 '14 at 16:16

for nonzero solutions of $|x|+|y|=15$, we can find coefficient of $x^{15}$ in the expansion of: $$(x+x^2+...+x^{15})^2 = \frac{x^2}{(1-x)^2}$$ which is 14. But since we accept -ve solutions, the number of nonzero solutions is $14\times4=56$. There are four solutions with zero: $x=0, y=\pm{15}$ and $y=0, x=\pm15$. for $|x|+|y|+|z| = 15$, by similar approach, the number of nonzero solutions is coeff. of $x^12$ in the expansion of $\frac{x^3}{(1-x)^3}$ which is 91. Again, $x, y \text{ and } z$ can be positive or negative giving $91\times8=728$ nonzero solutions. To this number of solutions with one zero are added: $728+3\times14\times4=728+168$. To this solutions with two zeros are added: 728+168+6=902

-
"-ve" "+ve" seriously? – Najib Idrissi May 28 '14 at 12:01
Should I be using the full words? or is there a logical flaw? – tpb261 May 28 '14 at 12:03
I think that you should be using full words, yes. It's not an insurmountable effort. – Najib Idrissi May 28 '14 at 12:04
@tpb261, how did you get this (x+x2+...+x15)2? How do I come to this conclusion and do we have some generalized explanation for that? – Sherlock Watson May 28 '14 at 14:50
if we assume that x, y and z are non zero, then x can take values from 1 to 15, the sum of powers will be: $(x+x^2+x^3+...+x^{15})$, Now all three are similar regarding the values acceptable, so in the product $(x+x^2+...+x^{15})^3$, the coefficient of $x^{15}$ is the what we would want, as it gives all possible ways of the summation to 15. – tpb261 May 28 '14 at 15:49