values of sums of consecutive integer squares

92 Views Asked by At

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!

1

There are 1 best solutions below

0
On BEST ANSWER

A characterization is available for $n$ being a square:

When is a sum of consecutive squares equal to a square?

Also, OEIS A001422 gives the full list of natural numbers not expressible as the sum of distinct squares at all: $$ \begin{array}{c} 2, 3, 6, 7, 8, 11, 12, 15, 18, 19, 22, 23, 24, 27, 28, 31, 32, 33, \\ 43, 44, 47, 48, 60, 67, 72, 76, 92, 96, 108, 112, 128. \end{array} $$ So all numbers $n\ge 129$ are a sum of distinct squares. A similar result might be true for consecutive squares; related literature is given in the article On Integers which are are representable as sums of large consecutive squares and the references therein.