My question is about the following problem:
Given some $n\in\mathbb{N}$, is $n$ a sum of squares of consecutive (nonnegative) integers (i.e. are there $r,s\in\mathbb{N}$ such that $n=\sum_{i=r}^si^2$)?
Is there an elegant, yet somehow elementary way to do this (in particular other than exhaustively trying values $(r,s)$ for some given $n$, or trying values for $r$ and solving for $s$)?
If there should be no such solution in general, what could be ideas that help with concrete examples? For example, $2018 = \sum_{i=7}^{18}i^2$. Could one get to this result using techniques from, say, an introductory lecture in algebra and elementary number theroy, without exhaustively testing values for either $r$ or $(r,s)$ (in notation from above)?
Any help is highly appreciated. Thanks in advance!
$$\frac{p(p+1)(2p+1)-q(q+1)(2q+1)}6=\frac{(2p^2+2pq+2q^2+3p+3q+1)(p-q)}6$$
– Feb 14 '18 at 13:58