How many possibilities are there of writing a natural number $M$ as a sum of $N$ natural numbers between $0$ and $M$?
For example, I need to write $4$, using $4$ numbers between $0$ and $4$. The possibilities are $$\begin{eqnarray*} 0+0+1+3 = 4 \\ 0+0+0+4 = 4 \\ 1+1+1+1 = 4 . \end{eqnarray*}$$
The answer is \begin{equation} p\left(M,N\right)=\binom{M+N-1}{N-1}=\frac{\left( M+N-1\right)\;!}{M\;!\left( N-1\right)\;!} \tag{1} \end{equation} but concerns ordered solutions $\left(x_{1},x_{2},\cdots ,x_{N}\right)$ : \begin{equation} x_{1}+x_{2}+\cdots +x_{N}=M \tag{2} \end{equation} So for $M=4$ and $N=4$ \begin{equation} p\left(4,4\right)=\binom{4+4-1}{4-1}=\frac{7\;!}{4\;!3\;!}=\frac{7\cdot 6 \cdot 5}{3 \cdot 2}=35 \tag{3} \end{equation}
The solutions $\left(0,1,3,0\right)$ and $\left(1,0,3,0\right)$ are considered different although they have the same summands.