<s>[INST] $(z + 1/z)^2 + (z^2 + 1/z^2)^2 + (z^3 + 1/z^3)^2 + (z^4 + 1/z^4)^4 + (z^5 + 1/z^5)^2 + (z^6 + 1/z^6)^2$ if $z^2 + z + 1 = 0$ 
Solve $(z + \frac{1}{z})^2 + (z^2 + \frac{1}{z^2})^2 + (z^3 + \frac{1}{z^3})^2 + (z^4 + \frac{1}{z^4})^2 + (z^5 +\frac{1}{z^5})^2 + (z^6 + \frac{1}{z^6})^2$
if $z^2 + z + 1  = 0$

I tried this problem and come up with this solution:
$z^2 + z + 1  = 0$
$z^2  = -z -1$
$(z^2)^2  = (-z -1)^2$
$z^4 + (z^2 + 1)  = z^2+2z+1+ (z^2 + 1)$
$z^4 + z^2 + 1  = 2(z^2 + z + 1) = 0$
and this help me to figure out that the answer is 12. However the step
$(z^2)^2  = (-z -1)^2$ isn't quite valid because it turns a quadratic equation to a quartic equation, which will lead to extreneous roots.
Therefore, I want to ask for a better solution to this. Thanks in advance.
 [/INST] $z+\dfrac1z=-1$
$z^2+\dfrac1{z^2}=\left(z+\dfrac1z\right)^2-2=?$
$z^3-1=(z-1)(z^2+z+1)=?$
</s>