6. If $f(x)=a_{0}+a_{1} x+a_{2} x^{2}+\cdots+a_{4} \cos x^{4028}$ is the expansion of $\left(x^{2}+x+2\right)^{2014}$, then
$$
2 a_{0}-a_{1}-a_{2}+2 a_{3}-a_{4}-a_{5}+\cdots+2 a_{4020}-a_{4027}-a_{4028}
$$

the value is $\qquad$ .
6.2.
$$
\text { Let } x=\omega\left(\omega=-\frac{1}{2}+\frac{\sqrt{3}}{2} \mathrm{i}\right) \text {. }
$$

Then $x^{2}+x+2=1$.
So $a_{0}+a_{1} \omega+a_{2} \omega^{2}+a_{3}+a_{4} \omega+\cdots+$ $a_{4026}+a_{4027} \omega+a_{4028} \omega^{2}=1$.
Taking the conjugate of the above equation, we get
$$
\begin{array}{l}
a_{0}+a_{1} \omega^{2}+a_{2} \omega+a_{3}+a_{4} \omega^{2}+\cdots+ \\
a_{4026}+a_{4027} \omega^{2}+a_{4028} \omega=1 .
\end{array}
$$

Adding the above two equations, we get
$$
\begin{array}{l}
2 a_{0}-a_{1}-a_{2}+2 a_{3}-a_{4}-a_{5}+\cdots+ \\
2 a_{4025}-a_{4027}-a_{4028}=2 .
\end{array}
$$