Calculating of sum $\sum_{z:\:z^n = 1} \frac{1}{2+z}$ with residues Let n be a natural number. I need to calculate the following sum: $$\sum_{z:\:z^n = 1} \frac{1}{2+z}$$ I had tried to find a function like $$\frac{\text{something}}{(z+2)(z^n - 1)}$$ so when i calculate residue of it at infinity i will have some nice equality on the sum due to equality of sum of all residues and residue at infinity with zero but hasn't managed. Asking for any tip.
 A: For a given root of unity (fix $n$), we can expand the sum as follows
$$\sum_{z^n=1} \frac{1}{2+z} = \frac{1}{2} \sum_{z^n=1} \sum_{k=0}^\infty \left(-\frac{z}{2}\right)^k$$
then we can swap the order of the summation and note that roots of unity to powers always returns a subset of those roots of unity, and the sum is always $0$ unless $ k \in n\Bbb{Z}$. In other words after the swap and a reindex $k = n l$:
$$\frac{1}{2}\sum_{k=0}^\infty \sum_{z^n=1} \left(-\frac{z}{2}\right)^k = \frac{1}{2}\sum_{l=0}^\infty \frac{n}{(-2)^{nl}} = \frac{n}{2+(-2)^{1-n}}$$
A: There are exactly $n$ distinct complex numbers $z$ such that $z^n=1$. They are $e^{\frac{2\pi ik}{n}},0\leq k\leq(n-1)$. We know that $$f(z)=z^n-1=\prod_{k=0}^{n-1}(z-e^{\frac{2\pi ik}{n}})$$ and also by logarithmic derivative we get
$$\frac{f'(z)}{f(z)}=\sum_{k=0}^{n-1}\frac{1}{(z-e^{\frac{2\pi ik}{n}})}$$ Now $$\frac{f'(z)}{f(z)}=\frac{nz^{n-1}}{z^n-1}$$
$$\sum_{z:z^n=1}\frac{1}{2+z}=-\sum_{k=0}^{n-1}\frac{1}{(-2-e^{\frac{2\pi ik}{n}})}=-\frac{f'(-2)}{f(-2)}=-\frac{n(-2)^{n-1}}{(-2)^n-1}$$
