<s>[INST] Calculate how many ways you can give $7$ children $7$ identical candies My try:

Calculate how many ways you can give $7$ children $7$ identical candies if each child got at most 2 candies.

$$x_1+x_2+x_3+x_4+x_5+x_6+x_7=7 \text{    for   } x_i \in \left\{ 0,1,2\right\}$$
$$[t^7](1+t+t^2)^7[t^7](\frac{1-t^3}{1-t})^7=[t^7](1-t^3)^7 \sum {n+6 \choose 6}t^n$$
$$\begin{array}{|c|c|c|c||c|c|}
\hline
\text{first parenthesis} & \text{ways in the first} & \text{ways in the second }\\ \hline
\text{1} & 1 & { 13 \choose 6} \\ \hline
{t^3} & { 1 \choose 1} & { 10 \choose 6} \\ \hline
{t^6}  &  { 7 \choose 2} & { 7 \choose 6}\\ \hline
\end{array}$$
Sollution:$${ 7 \choose 2}{ 7 \choose 6}+{ 7 \choose 1}{ 10 \choose 6}+{ 13 \choose 6}=3333$$
But I checked it in Mathematica and I get $393$. So can you check where the error is?
 [/INST] The solution will be confficent of $\,t^7 $ in the
expension of $${(1\, - \ t^3)}^7{(1 - t)}^{-7}$$
I.e coefficient of $t^7$ in $( \,1 - \, {7 \choose 1} t^3\,+{7 \choose 2} t^6)(1\,-t)^{-7}$ $$
= \,{13 \choose 7} \, - 7\,{10 \choose 4}\,+21{7 \choose 1} $$
= 393
</s>