How many solutions are there to $x+y+z=14$ where $x,y,z$ are all non-negative integers, $x \leq 5, y \leq 6, z \leq 7$? Through using brute force, I have got 15 triplets of solutions. Have I reached the right answer, and how can I not use brute force?

For the given conditions, the maximum values of x, y and z are:
$$\begin{align}
x={} & 5 \\
y= {} & 6\\
z = {} & 7 \\
\sup(x+y+z) = {} & 18
\end{align}$$
Hence we must subtract 4 from $x$, $y$ and $z$ collectively such that $x+y+z=14$.
Of the 5 partitions of 4, all except 1+1+1+1 are possible allocations.


*

*4+0+0 - ${3\choose1}=3$ ways of allocating.

*3+1+0 - $3!=6$ ways of allocating.

*2+2+0- ${3\choose1}=3$ ways of allocating.

*1+1+2- ${3\choose1}=3$ ways of allocating.


Thus, as you calculated, $3+6+3+3=15$ integer solutions.
