<s>[INST] For $(1 + x + x^2)^6$, find the term which has $x^6$ in it. 
For $(1 + x + x^2)^6$, find the term which has $x^6$ in it.

I tried to use Newton's binomial formula as:
$$
(1 + x + x^2)^6 = \sum_{k = 0}^{6}\left( \binom{6}{k}(1 + x)^{n-k} x^{2k}\right)
$$
and that's all I can think of, other then just to compute it.
 [/INST] This question might be easier to solve by hand.
However, the general way to solve it is to know that:
$$\frac1{(1-x)^k}=\sum_{n=0}^\infty \binom{n+k-1}{k-1}x^k$$
Then use:
$$x^2+x+1=\frac{1-x^3}{1-x}$$
So:
$$(x^2+x+1)^6 =(1-x^3)^6\frac1{(1-x)^3}$$
So the coefficient of $x^n$ is $$\sum_{k=0}^6(-1)^k\binom 6k\binom{n-3k+5}5$$
This gives, for $n=6,$
$$\binom{11}5-\binom61\binom85 +\binom62\binom55$$
because the other terms are zero.
</s>