How to evaluate $\sum_{n=1}^{38}\sin\left(\frac{n^8\pi}{38}\right)$ Evaluate $$\sum_{n=1}^{38}\sin\left(\frac{n^8\pi}{38}\right)$$
I have found the problem on this page.
I have no idea how to do it. Thank you very much.

We have:
$$\sum_{n=1}^{38}\sin\left(\frac{n^8 \pi}{38}\right) = \sum_{k=0}^{18}\sin\left((2k+1)^8 \frac{2\pi}{4\cdot 19}\right)+\sum_{k=0}^{18}\sin\left(2^6 k^8 \frac{2\pi}{19}\right),$$
where the first sum vanishes because $-2$ is a fourth power $\pmod{19}$, since $5^4+2\equiv0\pmod{19}$, while the second sum is just the imaginary part of a Gauss sum:
$$\sum_{k=0}^{18}\sin\left(2^6 k^8\frac{2\pi}{19}\right)=\Im\sum_{m=0}^{18}\left(\frac{m}{q}\right)\exp\left(7\cdot\frac{2\pi i m}{19}\right)=\sqrt{19}$$
because the eighth powers $\pmod{19}$ are just the quadratic residues.
