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.
 A: 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.
A: Not a solution, but I think this is the direction to investigate. First, let's consider instead the sum over complex exponentials (so that this particular sum will be the imaginary part). Then Mathematica gives the sum $$\sum_{n=1}^{38} \exp\left(\frac{i\pi n^8}{38}\right)=\sqrt{19}(1+i).$$ (As noted in comments, the same holds true if $38$ is replaced by some other even integers...but it's not clear which ones.)
This suggests that there's some rather generic result which we should be seeking. To approach this, note that for every eighth power we may write $n^8=76k+r$ for some integers $k,r$ with $r\in[0,76)$. Then 
$$ \exp\left(\frac{i \pi n^8}{38}\right)=\exp\left(2\pi k i+\frac{2\pi i r}{38}\right)=\exp\left(\frac{i\pi r}{38}\right)$$
which is a 76th root of unity.
So I think we in part need number-theoretic results: What can be said about $n^8$ for $n\in \mathbb{Z}/76\mathbb{Z}$?
