Say the first digit is 2.
So, the next 3 digits must sum to 2 by using 0,1,2.
How many ways can this be done?. We can list them out.
\(\displaystyle \begin{array}002\\200\\020\\101\\110\\011\end{array}\)
There are six if the first digit is 2.
As we go up, there are more each time.
How many ways can we make a sum of 3 using 3 of the digits from the set 0,1,2,3?.
In other words, \(\displaystyle x_{1}+x_{2}+x_{3}=3\)
Assuming \(\displaystyle 0\leq x_{1}\leq 3, \;\ 0\leq x_{2}\leq 3, \;\ 0\leq x_{3}\leq 3\)
This can be done in \(\displaystyle \binom{3+3-1}{3}=10\).
These can be listed out as well.
\(\displaystyle \begin{array} 003\\030\\300\\201\\210\\111\\120\\102\\021\\012\end{array}\)
So, if the sum is 2, we have 6 ways. \(\displaystyle \binom{2+3-1}{2}=6\)
If the sum is 3, we have 10 ways.
I think there is a pattern here. It has to do with the triangular numbers.
Are you familiar with the triangular numbers?.
The sum can be found by using \(\displaystyle \sum_{n=4}^{11}\frac{n(n-1)}{2}\)
Can you finish now?. The fourth triangular number is 6, the fifth is 10, and so on.
Let me know your thoughts on the matter.