# Let $\omega=e^{i2\pi/2015}$, evaluate $\sum\limits_{k=1}^{2014}\frac{1}{1+\omega^k+\omega^{2k}}$

Let $\omega=e^{i2\pi/2015}$, evaluate: $$S=\sum_{k=1}^{2014}\frac{1}{1+\omega^k+\omega^{2k}}$$

My Attempt:

Clearly, $1,\omega,\omega^2,\omega^3,...,\omega^{2014}$ are the $2015$th roots of unity.

Thus, $\omega^{2014}=\bar\omega$, $\omega^{2013}=\bar\omega^2$, and so on.

Note that $$\dfrac{1}{1+\omega^k+\omega^{2k}}+\dfrac{1}{1+\bar\omega^k+\bar\omega^{2k}}=\dfrac{1}{1+\omega^k+\omega^{2k}}+\dfrac{\omega^{2k}}{1+\omega^k+\omega^{2k}}=\dfrac{1+\omega^{2k}}{1+\omega^k+\omega^{2k}}$$ hence $$S=\sum_{k=1}^{1007}\frac{\omega^k+\omega^{-k}}{1+\omega^k+\omega^{-k}}=\sum_{k=1}^{1007}\frac{2\cos\left(\frac{2k\pi}{2015}\right)}{2\cos\left(\frac{2k\pi}{2015}\right)+1}$$

How to proceed from here. Appears to be standard trigonometric expression but I am not able to recall.

For simplicity I will write $n=2015$. Since $X^n-1=\prod\limits_{k=0}^{n-1}(X-\omega^k)$ we conclude that $$\frac{nX^{n-1}}{X^n-1}=\sum_{k=0}^{n-1}\frac{1}{X-\omega^k}$$ Substituting $X=j=e^{2i\pi/3}$ and $X= \overline{j}$ and then subtracting we get $$\frac{nj^{n-1}}{j^n-1}-\frac{n\bar{j}^{n-1}}{\bar{j}^n-1}=\sum_{k=0}^{n-1}\left(\frac{1}{j-\omega^k}-\frac{1}{\bar{j}-\omega^k}\right)=(\bar{j}-j)\sum_{k=0}^{n-1}\frac{1}{1+\omega^k+\omega^{2k}}$$ Finally, since $n=2015\equiv 2\mod 3$ we see that $j^{n-1}=j$ and $j^n=j^2=\bar{j}$, we get $$\frac{1}{-i\sqrt{3}}\left(\frac{nj}{j^2-1}-\frac{n\bar{j}}{j-1}\right)=\frac{1}{3}+\sum_{k=1}^{n-1}\frac{1}{1+\omega^k+\omega^{2k}}$$ The final step is easy and we get $$\sum_{k=1}^{n-1}\frac{1}{1+\omega^k+\omega^{2k}}=\frac{2n-1}{3}=1343$$ This conclusion is valid for every $n$ which is equal to $2\pmod3$.