x^2+x+1=0
x^2-(w+w2)x+(w3)=0[w refers to omega]
(x-w)(x-w2)=0
as A and B are roots then A=w and B=w2
now (1+A)^-n=(1+w)^-n=(-w^2)^-n=w^(2n)=w^(12k)[let n=6k]=(w^3)^(4k)=1
so,(1+A)^-n+(1+B)-n=1+(1+W2)-n=1+(-w)-n=1-w-n
if you put A=w^2 and B=w
ans is 1-w^2-n