How many nonnegative integral solutions for this equation $a+b+c+d=24$ with given conditions $a \leq b \leq c \leq d$ Find number of non negative integral solutions to this equation
$$a+b+c+d=24$$
such that $a⩽b⩽c⩽d$.
 A: Suppose that you want to solve the equation:
$$a_1+a_2+...+a_n=s$$
assuming that the minimum allowed value of $a_i$ is $m$ and $a_i\ge a_j$ if $i\ge j$. Denote the number of solutions of such equation as $f(n, m, s)$. Basically, you want to find $f(4, 0, 24)$ because you have 4 variables, these variables are greater or equal to zero and the total sum is 24.
Obviously:
$m\gt s\implies f(n, m, s)=0\tag{1}$
...which basically means that there is no solution if the minimum value of $a_i$ is greater than total $s$. Also we have:
$$n=1\land m\le s\implies f(n,m,s)=1\tag{2}$$
In other words, if you have only one variable and if the minimum allowed value is smaller than the total sum, there is exactly one solution.
And finally:
$$f(n,m,s)=\sum_{m'=m}^s f(n-1,m',s-m')\tag{3}$$
This simply means that you can pick the value of the first variable anywhere between the minimum allowed value $m$ and the total sum $s$ and find a number of solutions for the smaller sum with one variable less. When you sum all those solutions you get the final result.
Rules (1), (2) and (3) are sufficent to calculate the number of solutions for any $n,m,s$
You can represent these three rules in Mathematica in the following way:
f[length_, minimum_, total_] := 0 /; minimum > total

f[1, minimum_, total_] := 1  /; minimum <= total

f[length_, minimum_, total_] := Sum[f[length - 1, k, total - k], {k, minimum, total}]

Expression: 
f[4, 0, 24]

...returns 169.
The number of solutions grows fairly quickly. If you replace $s=24$ with $100$ the result is 8037.
A: The number you are looking for, is known as partition function of a number $n$ into $k$ non-negative parts (in your case $n=24$, $k=4$).
It can be computed as
$$
p_k(n+k),
$$
where $p_k(n)$ is the partition function of a number $n$ into $k$ positive parts. 
Though no closed-form expression for $p_k(n)$ exists, it can be easily computed by the recurrence relation:
$$
p_k(n) = p_k(n − k) + p_{k−1}(n − 1),
$$
with initial values  $p_k(n) = 0$, if $n ≤ 0$ or $k ≤ 0$, except for $p_0(0) = 1$.
In your case the result reads:
$$
p_4(28)=169.
$$
