Summation of rational complex function 
Let $z$ be a non-real complex number such that $z^{23}=1$. Compute $$\sum_{k=0}^{22} \frac {1}{1+z^k +z^{2k}}$$.

I could not really do much about this problem. I tried writing the summand as a geometric progression, i.e
$$\frac {\frac {z^k -1}{z-1}}{\frac {z^{3k} -1}{z-1}}=
\frac{1+z+z^2....+z^{k-1}}{1+z+z^2....+z^{3k-1}}$$
but it did not yield much. I also tried using the Euler's formula with $z= \exp\left(\frac{2k\pi i}{23}\right)$, $k\in\{0,1,2,\ldots,22\}$ but I don't know where to use it or if I should use this form here or not.
 A: This answer is incomplete: it's too large for a comment but a step in the right direction.
Let's generalize the problem somewhat: I'll put $n$ where you have 23, and retain $z$ a primitive $n^{th}$ root of unity. Note the sum is meaningless if $n$ is a multiple of 3. Introduce three related sums:
$$
S_{0,n}= \sum_{k=0}^{n-1} \frac{1}{1+z^k+z^{2k}};\qquad S_{1,n}= \sum_{k=0}^{n-1} \frac{z^k}{1+z^k+z^{2k}};\qquad S_{2,n}= \sum_{k=0}^{n-1} \frac{z^{2k}}{1+z^k+z^{2k}}
$$ Clearly we have $S_{0,n}+S_{1,n}+S_{2,n}=n$, since the summand just becomes $1$. Also, when $k=0$, each term is just $1/3$.
Now I claim $S_{0,n}=S_{2,n}$. Indeed, the sums are just reorderings of each other: for $1\leq k\leq n-1$, the $k^{th}$ term of $S_{0,n}$ is the $(n-k)^{th}$ term of $S_{2,n}$.
The behavior of $S_{1,n}$ is more interesting: it seems to depend on $n\bmod 3$. The proof is eluding me, but I'm going to conjecture that if $n\equiv 1 (3),$ $S_{1,n}=n/3$, and if $n\equiv 2 (3),$ $S_{1,n}=-n/3$. Together with the previous observations, this would imply
$$
\begin{cases}
(S_{0,n},S_{1,n},S_{2,n}) = \left(\frac{n}{3},\frac{n}{3},\frac{n}{3}\right),& n\equiv 1 (3)\\
(S_{0,n},S_{1,n},S_{2,n}) = \left(\frac{2n}{3},\frac{-n}{3},\frac{2n}{3}\right),& n\equiv 2 (3)\\
\end{cases}
$$At any rate, as can be checked by direct computation, we have $S_{2,23}=46/3$. Sorry I couldn't be of more help!
