How to prove sum of powers property of roots of unity?

Note we can write $\alpha_k=e^{i\frac{2\pi}{n}k}$ then if $m$ is a multiple of $n$ we have $\alpha_k^m=1$ thus then we have $$1+\sum_{k=1}^{n-1} 1=n$$ otherwise we get that $\alpha_1^m \neq 1$. Then we get \begin{align*} 1+ \sum_{k=1}^{n-1} \alpha_k^m &= \sum_{k=0}^{n-1} e^{i\frac{2\pi}{n}mk}\\ &=\frac{1-e^{i2\pi m}}{1-e^{i\frac{2\pi}{n}m}}\\ &= \frac{0}{1-e^{i\frac{2\pi}{n}m}}=0 \end{align*}


The roots of $z^n=1$ are $\alpha_k= \omega^k$, where $\omega = \exp(2\pi i/n)$.

When $m$ and $n$ are coprime, the map $z \mapsto z^m$ permutes these roots and so $$ 1^m+\alpha_1^m+\alpha_2^m+\cdots+\alpha_{n-1}^m =1+\alpha_1+\alpha_2+\cdots+\alpha_{n-1} =0 $$

When $m$ is a multiple of $n$, the map $z \mapsto z^m$ is the constant map $1$ on these roots and so $$ 1^m+\alpha_1^m+\alpha_2^m+\cdots+\alpha_{n-1}^m =1+1+1+\cdots+1 =n $$

When $1 < \gcd(m,n)=d< n$, you get $d$ sums of the same form, but now for $n/d$-th roots of unity and so it's $0$ again, by the first case.

For instance, take $n=6$ and $m=2$. Then $$ \omega^0+\omega^2+\omega^4+\omega^6+\omega^8+\omega^{10} = \omega^0+\omega^2+\omega^4+\omega^0+\omega^2+\omega^{4} = 2(\lambda^0+\lambda^1+\lambda^2) $$ where $\lambda=\omega^2$ is the primitive cubic root of unity.