TITLE: Number of positive unequal integer solutions of $x+y+z+w=20$
QUESTION [7 upvotes]: What is the number of positive different integer solutions of $x+y+z+w=20$, where $x,y,z,w$ are all different and positive?
It would be nice if coding is not used.  I am given the answer $552$.

REPLY [2 votes]: Here is the best Solution I found when I was preparing for IIT-JEE 2000-2003.
suppose equation is $x + y +z + t = N$
find $k= [(N-2n-4)/2]$, where n is the least integer present is the solution.
for example to find number of solutions in which least number present is $1$, put $n=1$.
Now draw the following diagram

Stop when $1$ comes.
Now If $N$ is even add lower row terms along with middle row terms and multiply the sum with $4!$. This is the number of unequal integral solution of above equation having n as the least integer.
If $N$ is odd add upper row terms along with middle row terms and multiply the sum with $4!$.
Repeat the process for other possible values of $N$.
In above case $n$ can have values $0, 1, 2$, & $3$, if we are interested in finding non-negative unequal integral solutions, because $4 + 5 + 6 + 7 > 20$
for $n=0$, there are $24\times 4!$ solution
for $n=1$, there are $14\times 4!$ solutions
for $n=2$, there are $7\times 4!$ solutions
and for $n=3$, there are $2\times 4!$ solutions.
Total number of non-negative solutions can be obtained by adding all$= 1128$
If you are interested in only positive unequal integral solutions drop the case of n=0, and you get $552$
If you wish to obtain solution for $x, y, z, t > 1$, drop the case $n=0$ and $n=1$ both, and you get $216$. 
and so on.......