Sum of squares a square?

The sum of squares of two integers can be an integer. For example, $3^2 + 4^2 = 25^2$. Those are also the legs of a right-angle triangle. This example is special in that the numbers $3$ and $4$ are consecutive integers!

Can you find a sum of squares of three consecutive integers that make a square?

No, it's not possible. If $n$ is any integer, then the sum
$$n^2 + (n+1)^2 + (n+2)^2 = 3n^2 + 6n + 5.$$
Now, modulo three, any number squared is either 0 or 1. But this polynomial always outputs integers that are 2 mod 3. Therefore, the sum of three consecutive integers cannot be a perfect square.

Exercise: prove that the sum of squares of four consecutive integers cannot be a perfect square.

Maybe, you might be inclined to think that 2 is somehow special, and that a sum of squares of $k$ consecutive integers cannot be a perfect square if $k \gt 2$. But then you would be surprised at this sum of squares of fifty consecutive integers:
$$7^2 + 8^2 + 9^2 + \cdots + 55^2 + 56^2 = 60025 = 245^2.$$
Cool, right? This is by no means the smallest example. Here is another example of 407 consecutive integers:

$$183^2 + 184^2 + \cdots + 589^2 = 8140^2.$$

But are there infinitely many such examples?


Leave a comment

Fields marked with * are required. LaTeX snippets may be entered by surrounding them with single dollar signs. Use double dollar signs for display equations.