<s>[INST] $\sum_{k=1}^{n-1}\left(1-e^{\frac{2\pi ki}{n}}\right)^{-1}$ How can I go about computing
$$
\sum_{k\ =\ 1}^{n - 1}
\left(1 - \mathrm{e}^{\large 2\pi k\mathrm{i}/n}\right)^{-1}\
{\Large ?}
$$
I originally thought that it was supposed to be the reciprocal of the sum, and I ended up with $1/n$, but now I realized that it is the sum of the reciprocals. I've tried using
$$e^{ix}=\cos x+i\sin x,$$
but I didn't get anywhere with that.
 [/INST] With $\zeta = \exp(2\pi i/n)$ and
$$f(z) = \frac{1}{1-z} \frac{n/z}{z^n-1}$$
we have for $1\le k\le n-1$
$$\mathrm{Res}_{z=\zeta^k} f(z)
= \frac{1}{1-\zeta^k}$$
so that
$$S = \sum_{k=1}^{n-1} \frac{1}{1-\zeta^k}
= \sum_{k=1}^{n-1} \mathrm{Res}_{z=\zeta^k} f(z).$$
Residues sum to zero and the residue at infinity is zero, so we find
$$S = - \mathrm{Res}_{z=1} f(z) - \mathrm{Res}_{z=0} f(z).$$
For the first one we have
$$- \mathrm{Res}_{z=1} f(z)
= \mathrm{Res}_{z=1} \frac{1}{z-1} \frac{n/z}{z^n-1}
\\ = \mathrm{Res}_{z=1} \frac{1}{(z-1)^2}
\frac{n/z}{1+z+\cdots+z^{n-1}}
\\ = n
\left.\left(\frac{1}{z} \frac{1}{1+z+\cdots+z^{n-1}}
\right)'\right|_{z=1}
\\ = n
\left.\left(- \frac{1}{z^2} \frac{1}{1+z+\cdots+z^{n-1}}
- \frac{1}{z} \frac{(1+\cdots+(n-1) z^{n-2})}
{(1+z+\cdots+z^{n-1})^2}
\right)\right|_{z=1}
\\ = n
\left( - \frac{1}{n} - \frac{1}{n^2} \frac{1}{2} (n-1) n \right)
= -1 - \frac{1}{2} (n-1).$$
The second one is
$$- \mathrm{Res}_{z=0} f(z) = - (1 \times n \times -1) = n.$$
Collecting everything we get
$$\bbox[5px,border:2px solid #00A000]{
S = \frac{1}{2} (n-1).}$$
</s>