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?
 A: As was commented, the only issue is the sign of the middle term must be negative. To see it, express the first binomial as a sum too:
$$[t^7](1-t^3)^7 \sum {n+6 \choose 6}t^n=[t^7]\sum_{k=0}^7{7\choose k}(-t^3)^k \sum_{n=0}^{\infty} {n+6 \choose 6}t^n=\\
\underbrace{{7\choose 0}{13\choose 6}}_{k=0,n=7}-\underbrace{{7\choose 1}{10\choose 6}}_{k=1,n=4}+\underbrace{{7\choose 2}{7\choose 6}}_{k=2,n=1}=393.$$
A: There is a much simpler method to solve this problem. Generally these sort of problems are classified as NP and can only be solved numerically. 
OK! Back to the question, you can give each child exactly one candy which is possible in 1 way.
You can give 2 candies to one of them in 7 ways and the rest at most 1 candy each, in $\binom{6}{5}$ ways, totally leading to 42 ways.
You can give 2 candies to two of them in $\binom{7}{2}$ ways and the rest at most 1 candy each, in $\binom{5}{3}$ ways, totally leading to 210 ways.
You can give 2 candies to three of them in $\binom{7}{3}$ ways and the rest at most 1 candy each, in $\binom{4}{1}$ ways, totally leading to 140 ways.
Adding up all the cases, leads to a total of 393 different ways.
A: 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
