6. Let $\left(1+x+x^{2}\right)^{n}=a_{0}+a_{1} x+a_{2} x^{2}+\cdots+a_{2 n} x^{2 n}$, then $a_{2}+a_{4}+a_{6}+\cdots+a_{2 n}=$
Take $x=0 \Rightarrow a_{0}=1$; take $x=-1 \Rightarrow a_{0}-a_{1}+a_{2}-\cdots+a_{2 n}=1$; take $x=1 \Rightarrow a_{0}+a_{1}+a_{2}+\cdots+a_{2 n}=3^{n}$, so $a_{2}+a_{4}+a_{6}+\cdots+a_{2 n}=\frac{3^{n}+1}{2}-1=\frac{3^{n}-1}{2}$.