Does somebody have a nice proof of the following?
$$\prod_{m=1}^{n-1} \frac{e^{2\pi i k m/n} - 1}{e^{2 \pi i m / n} - 1} = \begin{cases} 1 & \text{ if $\gcd(k, n) = 1$} \\ 0 & \text{otherwise} \end{cases}$$
I can prove that if $\gcd(k, n) \neq 1$, then one of the factors is $0$ and the product is $0$.
But how to prove that it equals $1$ in the other case?
Note
I am not entirely sure that it is correct, but numerical tries with matlab suggests it is true.
In the case of that $\gcd(k,n)=1$ the product is $1$, since the factors in the numerator are exactly the same as in the denominator.
Indeed, it is well known that $a\equiv b\pmod n$ if and only if $e^{2\pi ia/n}=e^{2\pi ib/n}$. I have said that the factors in the numerator are the same as in the denominator, and this is true, but they are not in the same order (in general). To show this, it suffices to check that if $km\equiv km'\pmod n$ then $m\equiv m'\pmod n$, for that this proves that all the factors in the numerator are different, and there are only $n-1$ different $n$-roots of unity other than $1$ itself.
Suppose then that $km\equiv km'\pmod n$. To say that is to say that $n$ divides $k(m-m')$. Since $n$ and $k$ are coprime, $n$ divides $m-m'$, q.e.d.