On the "funny" identity $\tfrac{1}{\sin(2\pi/7)} + \tfrac{1}{\sin(3\pi/7)} = \tfrac{1}{\sin(\pi/7)}$

I would suggest a further simplification of your problem, namely that $ \frac{1}{ \sin (\pi/ M_n) } = - \frac{1}{ \sin ( 2^n \pi / M_n)} $. The identity then becomes

$$ \sum_{i=1}^n \frac{1}{\sin (2^n \pi / M_n )} = 0. $$

We now use

$$ \frac{1}{\sin \theta} = \cot \frac{\theta}{2} - \cot \theta,$$

which you can verify for yourself, to conclude that the result follows from telescoping, since $ \cot \frac{ \pi}{2^n - 1} = \cot \frac{ 2^n \pi } { 2^n - 1}$.

Note: I got the trig identity from Wikipedia trig identity, knowing that I wanted $\csc \theta$ and something that could telescope.


Let $$\displaystyle S=\sum_{k=1}^{n-1}\csc \left(\frac{2^k \pi}{2^n-1} \right)$$ Using Euler's Formula, we can express this sum in terms of complex numbers. $$S=\sum_{k=1}^{n-1} \frac{2i}{e^{i 2^k \pi/(2^n-1)}-e^{-i2^k\pi /(2^n-1)}}=2i \sum_{k=1}^{n-1}\frac{e^{i 2^k \pi/(2^n-1)}}{e^{i 2^{k+1}\pi/(2^n-1)}-1}$$ For simplicity, let us assume $x=e^{i\pi/(2^n-1)}$. Then $$\begin{align*} S &= 2i\sum_{k=1}^{n-1}\frac{x^{2^k}}{x^{2^{k+1}}-1} \\ &= 2i \sum_{k=1}^{n-1}\frac{(x^{2^k}+1)-1}{(x^{2^k}+1)(x^{2^k}-1)} \\ &= 2i \sum_{k=1}^{n-1}\left( \frac{1}{x^{2^k}-1}-\frac{1}{x^{2^{k+1}}-1}\right) \end{align*}$$ This is a telescoping sum and it's value is $$\begin{align*} S &= 2i \left( \frac{1}{x^2-1}-\frac{1}{x^{2^n}-1}\right) \end{align*}$$ Back substituting, gives $$\begin{align*} S &= 2i \left( \frac{1}{e^{2i\pi/(2^n-1)}-1}-\frac{1}{e^{i 2^n \pi/(2^n-1)}-1}\right) \\ &= 2i \left( \frac{1}{e^{2i\pi/(2^n-1)}-1}+\frac{1}{e^{i\pi/(2^n-1)}+1}\right)\\ &= 2i \frac{e^{i\pi/(2^n-1)}}{e^{2i\pi/(2^n-1)}-1} \\ &= \csc \left( \frac{\pi}{2^n-1}\right) \end{align*}$$ as desired.