TITLE: On the "funny" identity $\tfrac{1}{\sin(2\pi/7)} + \tfrac{1}{\sin(3\pi/7)} = \tfrac{1}{\sin(\pi/7)}$
QUESTION [22 upvotes]: This equality in the title is one answer in the MSE post Funny Identities. At first, I thought it had to do with $7$ being a Mersenne prime, but a little experimentation with Mathematica's integer relations found,
$$\frac{1}{\sin(2\pi/15)} + \frac{1}{\sin(4\pi/15)} + \frac{1}{\sin(7\pi/15)} = \frac{1}{\sin(\pi/15)}$$
$$\frac{1}{\sin(2\pi/31)} + \frac{1}{\sin(4\pi/31)} + \frac{1}{\sin(8\pi/31)} + \frac{1}{\sin(15\pi/31)} = \frac{1}{\sin(\pi/31)}$$
so the Mersenne number need not be prime. Let $M_n = 2^n-1$. How do we prove that,
$$\frac{1}{\sin(M_{n-1}\pi/M_n)}+\sum_{k=1}^{n-2} \frac{1}{\sin(2^k\pi/M_n)} = \frac{1}{\sin(\pi/M_n)}$$
indeed holds true for all integer $n>2$?
Edit (an hour later):
I just realized that since, for example, $\sin(3\pi/7)=\sin(4\pi/7)$, then the question can be much simplified as,
$$\sum_{k=1}^{n-1} \frac{1}{\sin(2^k\pi/M_n)} \overset{?}{=} \frac{1}{\sin(\pi/M_n)}$$

REPLY [14 votes]: 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.