Let $S=\sum_{k=1}^{m}e^{2\pi ik^2/m}$,if $m$ is odd,how to directly calculate the absolute value of $S=\sqrt{m}$.Don't use Gauss sum since here it says "it's easily shown"
My try is as follows: $$ \begin{align}S^2&=\left(\sum_{k=1}^{m}e^{2\pi ik^2/m}\right)\left(\sum_{k=1}^{m}e^{-2\pi ik^2/m}\right) \\&=\sum_{k=1}^{m-1}\sum_{d=1}^{m-k}2\cos\left(\frac{2\pi}{m}(2dk+k^2)\right)+m\end{align}$$ we must prove $\sum_{k=1}^{m-1}\sum_{d=1}^{m-k}2\cos(\frac{2\pi}{m}(2dk+k^2))=0$.If m is small, I can directly calculate, but if m is large, how to do so by induction or any other solutions.