If $z^{23}=1$ then evaluate $\sum^{22}_{z=0}\frac{1}{1+z^r+z^{2r}}$ 
If $z$ is any complex number and $z^{23}=1$ then evaluate $\displaystyle \sum^{22}_{r=0}\frac{1}{1+z^r+z^{2r}}$

Try: From $$z^{23}-1=(z-1)(1+z+z^2+\cdots  +z^{22})$$
And our sum $$\sum^{22}_{r=0}\frac{1}{1+z^r+z^{2r}}=\frac{1}{3}+\frac{1}{1+z+z^2}+\frac{1}{1+z^2+z^4}+\cdots  +\frac{1}{1+z^{22}+z^{44}}$$
Now i did not understand how can i simplify it.
Could some help me. Thanks. 
 A: If $z^{23}=1$ and $z\not=1$ (otherwise the sum is trivially equal to $23/3$) then $z^k$ is a primitive $23$-th root of unity for any $k=1,2\dots,22$  (note that $23$ is a prime number). Hence
$$\begin{align}
\sum^{22}_{r=0}\frac{1}{1+z^r+z^{2r}}&=\frac{1}{3}+\sum_{r=1}^{22}\frac{1}{1+z^r+z^{2r}}\\
&=\frac{1}{3}+\sum_{r=1}^{22}\frac{1}{1+z^{8r}+z^{16r}}\\
&=\frac{1}{3}+\sum_{r=1}^{22}\frac{z^{8r}-1}{(1+z^{8r}+z^{16r})(z^{8r}-1)}\\
&=\frac{1}{3}+\sum_{r=1}^{22}\frac{z^{8r}-1}{z^{24r}-1}
=\frac{1}{3}+\sum_{r=1}^{22}\frac{z^{8r}-1}{z^{r}-1}\\
&=\frac{1}{3}+\sum_{r=1}^{22}(1+z^r+z^{2r}+z^{3r}+z^{4r}+z^{5r}+z^{6r}+z^{7r})\\
&=\frac{1}{3}+22+7\sum_{r=1}^{22}z^r.
\end{align}$$
Can you take it from here?
A: Define $f(x)=\frac{1}{1+x+x^2}$. Then we have to calculate
$$
\sum_{k=0}^{22}f(z^k)=\frac{1}{3}+\sum_{k=1}^{22}f(z^k).
$$
Let's work out the polynomial expression for $f$ using $(a+b)(a-b)=a^2-b^2$.
$$
f(s)=\frac{s-1}{s^3-1}=\frac{(s-1)(s^3+1)}{s^6-1}=\frac{(s-1)(s^3+1)(s^6+1)}{s^{12}-1}=\frac{(s-1)(s^3+1)(s^6+1)(s^{12}+1)}{s^{24}-1}.
$$
Since $s^{24}=s$ for the $23$d roots of unity, we get
$$
f(z^k)=(z^{3k}+1)(z^{6k}+1)(z^{12k}+1)=1+z^{3k}+z^{6k}+z^{9k}+z^{12k}+z^{15k}+z^{18k}+z^{21k}.\tag{1}
$$
Now as the OP has noticed
$$
s^{23}-1=(s-1)(1+\underbrace{s+s^2+\ldots+s^{22}}_{\Phi(s)}).
$$
For the $z^k$, $k=1,2,\ldots,22$, it makes (as all those are primitive roots)
$$
0=\underbrace{(z^k-1)}_{\ne 0}(1+\Phi(z^k))\quad\Leftrightarrow\quad \Phi(z^k)=-1.
$$
Finally, summing up (1) we get
$$
\sum_{k=1}^{22}f(z^k)=22+\Phi(z^3)+\Phi(z^6)+\Phi(z^9)+\Phi(z^{12})+\Phi(z^{15})+\Phi(z^{18})+\Phi(z^{21})=22-7=15.
$$
Plus $\frac13$.
