Let $\omega_n^k=\exp(2\pi ik/n)$ be the $n$-th roots of unity. I've come across the following sum a couple of times now (for example in a problem on hydrodynamics): $$ \sum_{k=1}^{n-1}\frac{1}{1-\omega_n^k}=\frac{n-1}{2} $$ The imaginary part can be seen to be $0$ by symmetry while $\mathrm{Re}(1/(1-z))=1/2$ if $|z|=1$, so the result quickly follows.
What I began to wonder was how large the imaginary parts that cancel out are - in other words, I'm looking for a way to calculate the following sum: $$ \sum_{\mathrm{Im}\,\omega_n^k>0}\frac{1}{1-\omega_n^k}=\frac{1}{2}\left\lfloor\frac{n-1}{2}\right\rfloor+ix $$ Here $x\in\mathbb{R}$. Is there some nice closed form for $x$?