Find the numerical value of this expression If $x$ is a complex number such that $x^2+x+1=0$, then the numerical value of $(x+\frac{1}{x})^2+(x^2+\frac{1}{x^2})^2+(x^3+\frac{1}{x^3})^2+\ldots+(x^{27}+\frac{1}{x^{27}})^{2}$ is equal to?
A) 52 .   B) 56 .   C) 54.   D)58 .  E)None of these
Where is this question from?  I'm pretty sure it comes from one high school math contest, does anyone one know which math contest and of course i can't solve, I have an answer key but I don't know the solution.

Thank you for all your answers, I just find the other solution to solve this, so I want to post it here.
Since $x^2+x+1=0$, so we can find 
$x+\frac{1}{x}=-1$ 
and $x^2+\frac{1}{x^2}=(x+\frac{1}{x})^2-2=(-1)^2-2=-1$. Let's keep going
$x^3+\frac{1}{x^3}=(x+\frac{1}{x})(x^2+\frac{1}{x^2})-(x+\frac{1}{x})=(-1)(-1)-(-1)=2$
$x^4+\frac{1}{x^4}=(x^2+\frac{1}{x^2})^2-2=(-1)^2-2=-1  $
$x^5+\frac{1}{x^5}=(x^2+\frac{1}{x^2})(x^3+\frac{1}{x^3})-(x^2+\frac{1}{x^2})=(-1)(-1)-2=-1    $
$x^6+\frac{1}{x^6}=(x^5+\frac{1}{x^5})(x+\frac{1}{x})-(x^4+\frac{1}{x^4})=(-1)(-1)-(-1)=2$
......
So it has a period,-1,-1,2,-1,-1,2,-1,-1,-2.......until the last term.
The sum of the one period is $(-1)^2+(-1)^2+(2)^2=6$, and we have 27$\div$ 3=9, so the final value is equal to 6$\times$9=54.
