<s>[INST] Root of unity , find $Re(z^{2557})+Im(z^{2014})$ 
Let $x = e^{\frac{2i\pi}{2n+1}}$ and let $z = \frac{1}{2} + x + x^2 + \cdots + x^n$. Find $Re(z^{2557}) + Im(z^{2014})$.

My Work
$1 + x + x^2 + \cdots + x^{2n} = 0$
$(1 + x + x^2 + \cdots + x^n) + x^n(1 + x + x^2 + \cdots + x^n) = x^n$
$z +\frac{1}{2} = \frac{x^n}{1+x^n}$
$z = \frac{x^n - 1}{2(1+x^n)}$.
Now, how can I proceed?
Thanks in advance!
 [/INST] Let $\frac {2n\pi}{2n+1}=a$
Then we have, from Euler's formula:
$$z=\frac {x^n-1}{2(x^n+1)}=\frac {(\cos a-1)+i\sin a}{2((\cos a+1) +i\sin a)}=\frac {((\cos a-1)+i\sin a)((\cos a+1)-i\sin a)}{2((\cos a +1)^2+ \sin^2 a)}=\frac {2i\sin a}{4(1+\cos a)}=\frac {\tan {\frac {a}{2}}}{2} i$$
So, $z$ is purely imaginary, hence real part will be zero and you will get a closed form for the imaginary part.
</s>