Prove that $$\sum_{n = 1}^{2160}\exp\left(\pi i\frac{n(n + 1)(2n + 1)}{1080}\right) = 0$$
This question was posted and closed for lack of context and - mainly, I guess - progress by the OP. I wasn't sure if I should have edited that question, posed by someone else, with my attempts; I saw a similar situation here and therefore decided to post my own question, including my own effort, since I find this problem interesting, hoping that it can be answered by someone. To be fair, I am not even sure the identity is true [it is true, see my edit below].
Like someone suggested in the comments of that post, it is easy to see that $$\sum_{k=1}^nk^2=\frac{n(n+1)(2n+1)}6,$$ so the sum can be written in the form $$\sum_{n=1}^{2160}\exp\left({\frac{\pi i}{180}\sum_{k=1}^n k^2}\right).$$
However, I can't see how this form might help solve the problem [well, I couldn't. Again, have a look at my edit]. On the other hand, it is well known that the sum of the $n$-th roots of unity is $0$, and I thought this result could be useful. [At the beginning it turned out not to be; here is my first attempt. Later I came up with a way to make use of this fact, as you can see below].
The roots of $z^{2160} = 1$ satisfy an identity similar to the goal: $$\sum_{n = 1}^{2160}\exp\left(2\pi i \frac{n}{2160}\right) = 0.$$
Next, observe that if $n_1, n_2 \in \mathbb{N}$ are such that $n_1 \equiv n_2 \pmod {2160}$, and so $\exists c \in \mathbb{N}: n_1 = n_2 + 2160c$, then
\begin{aligned} \exp\left(2\pi i\frac{n_1}{2160}\right) &= \exp\left(2\pi i\frac{n_2 + 2160c}{2160}\right) \\ &= \exp\left[2\pi i \left(\frac{n_2}{2160} + c\right)\right] \\ &= \exp\left(2\pi i \frac{n_2}{2160} + 2\pi i c\right) \\ &= \exp\left(2\pi i \frac{n_2}{2160}\right) \exp\left(2\pi i c\right) \\ &= \exp\left(2\pi i \frac{n_2}{2160}\right) \end{aligned}
Since our sum can be written in the form $$\sum_{n = 1}^{2160}\exp\left(2\pi i\frac{n(n + 1)(2n + 1)}{2160}\right),$$ I was then wondering if all the numbers from $0$ to $2159$ appear (exactly once) when evaluating $n(n + 1)(2n + 1) \pmod{2160}, n=1,2,\dots,2160$, to replace $n(n + 1)(2n + 1)$ in the sum with the remainder and make use of the sum of the roots of the unity. Running a simple excel program, though, I observed that both $59 \cdot 60 \cdot 119$ and $60 \cdot 61 \cdot 121$ are congruent to $60 \pmod {2160}$.
I wonder if any of you knows an alternative strategy to solve this problem. Unfortunately, I cannot provide additional context because I am not really the OP, but I let my Professor of Complex Analysis have a quick look at this problem and he said something about Gauss Sums; I don't know very much about them and they look like an advanced topic. Perhaps an easier solution exists.
[EDIT #$1$:] Using the formula for the sum of the first $n$ squares, the problem simplifies a little bit, since it is not necessary to evaluate numbers $\pmod {2160}$ anymore, but "only" $\pmod {360}$. $$\sum_{n=1}^{2160}\exp\left({\frac{\pi i}{180}\sum_{k=1}^n k^2}\right) = \sum_{n=1}^{2160}\exp\left({\frac{2\pi i}{360}\sum_{k=1}^n k^2}\right).$$
Observe that now, though, it is impossible that all the numbers from $0$ to $359$ are obtained exactly once from $\sum_{k=1}^n k^2 \pmod {360}, n=1,2,\dots,2160$, by the pigeonhole principle. However, I thought that maybe each remainder could appear exactly $6$ times to apply the formula for the sum of the $360$th-roots of unity $6$ times.
Again, this is not the case, but running another simple excel program I noticed that something very interesting happens: there is a sort of "loop" $\pmod 5$, in the sense that the function $c(m), m=0,1,\dots,359$ which counts how many times each remainder is obtained, i.e. $$c(m):=\left|\left\{n=1,2,\dots,2160 : m \equiv \sum_{k=1}^n k^2 \pmod {360}\right\}\right|$$ gives
$$\begin{array}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c} \hline m & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & \dots\\ \hline c(m) & 18 & 6 & 0 & 0 & 6 & 18 & 6 & 0 & 0 & 6 & \dots\\ \hline \end{array}$$
This led me to write:
\begin{aligned} &\sum_{n=1}^{2160}\exp\left({\frac{2\pi i}{360}\sum_{k=1}^n k^2}\right) \\ = &18 \exp\left(\frac{2\pi \cdot 0 \cdot i}{360} \right) + 6 \exp\left(\frac{2\pi \cdot 1 \cdot i}{360} \right) + 6 \exp\left(\frac{2\pi \cdot 4 \cdot i}{360} \right) \\ &+ 18 \exp\left(\frac{2\pi \cdot 5 \cdot i}{360} \right) + 6 \exp\left(\frac{2\pi \cdot 6 \cdot i}{360} \right) + 6 \exp\left(\frac{2\pi \cdot 9 \cdot i}{360} \right) \\ &+ \cdots \\ &+ 18 \exp\left(\frac{2\pi \cdot 355 \cdot i}{360} \right) + 6 \exp\left(\frac{2\pi \cdot 356 \cdot i}{360} \right) + 6 \exp\left(\frac{2\pi \cdot 359 \cdot i}{360} \right) \\ = &\left[18 + 6 \exp\left(i\frac{2\pi}{360} \right) + 6 \exp\left(i\frac{8\pi}{360} \right)\right] \cdot \left[1 + \exp\left(i\frac{10\pi}{360} \right) + \dots + \exp\left(i\frac{710\pi}{360} \right)\right] \\ = &\left[18 + 6 \exp\left(i\frac{2\pi}{360} \right) + 6 \exp\left(i\frac{8\pi}{360} \right)\right] \cdot \underbrace{\left[1 + \exp\left(2\pi i\frac{1}{72} \right) + \dots + \exp\left(2\pi i\frac{71}{72} \right)\right]}_\text{0} \\ = &0 \end{aligned}
since the second term is the sum of the roots of $z^{72}=1$! My intuition was fruitful, at the end of the day.
This ensures that the identity is indeed true, but I used my computer a lot before following this path. A lot of mystery remains: how could one find out (or at least prove) the "loop" of the table without a software? And, more importantly, what is special about $2160$? This is far away from being a solved problem.