$(1+x+x^2)^n=P_0+P_{1}x + P_{2}x^2+ \cdots +P_{2n}x^{2n}$ Prove that,$ P_0+P_{3}+P_{6}+ \cdots =3^{(n-1)}$ Let's say $$ S_n = (1+x+x^2)^n $$
n=1 $$S_1=1+x+x^2$$
n=2 $$S_2=1+2x+3x^2+2x^3+x^4$$
n=3 $$S_3=1+3x+6x^2+7x^3+6x^4+3x^5+x^6$$
n=4 $$S_4=1+4x+10x^2+16x^3+19x^4+16x^5+10x^6+4x^7+x^8$$
By taking coefficients of the $S_n$ we can form this type of triangle similar to Pascal's Trinagle
$$\begin{matrix}
&&&&&&&&&1\\
&&&&&&&1&&1&&1\\
&&&&&1&&2&&3&&2&&1\\
&&&&1&&3&&6&&7&&6&&3&&1\\
&&1&&4&&10&&16&&19&&16&10&&4&&1
\end{matrix}$$

Let us denote $\omega$ as the third root of unity .
Therefore , ${\omega}^3 = 1$.
And ${\omega}^2 + \omega + 1=0$.
Now , $$(1+x+x^2)^n= P_0 + P_1x + P_2{x^2} + \ldots + P_{2n}x^{2n}....(1)$$
Putting $x=1$ in equation (1) ,we get
$$3^n= P_0 + P_1x + P_2{x^2} + \ldots + P_{2n}x^{2n}....(2)$$
Putting $x= \omega$ in (1) we get
$$(1+\omega + {\omega}^2)^n= 0 = P_0 + P_1\omega + P_2{\omega^2} + \ldots + P_{2n}\omega^{2n}....(3)$$
Putting $x=\omega^2$ in equation (1) we get ,
$$(1+\omega^2  + \omega^4)^n = 0 =P_0 + P_1\omega^2 + P_2{\omega^4} + \ldots + P_{2n}\omega^{4n} ....(4)$$
Adding equations (2) ,(3) and (4) we get ,
$$3^n = 3( P_0 + P_3 + P_6 + \ldots )$$
Therefore , $$(P_0 + P_3 + P_6 + \ldots ) = \frac{3^n}{3}= 3^{n-1}$$
