Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This comic points out an interesting identity with sums of consecutive squares. Let us take positive integers $k, p, q$, with $p < q$, and ask if $k^2 + \ldots + (k + p)^2 = (k + p + 1)^2 + \ldots + (k + q)^2$. One may see this is equivalent to $(p+1)(6k^2 + 6kp + 2p^2 + p) = (q - p)(6k^2 + 6k(p + q + 1) + 2p^2 + p(2q + 3) + 2q^2 + 3q + 1)$. Surprisingly, there is an easy family of triples $(k, p, q)$ of solutions: $(p(2p + 1), p, 2p)$. Searching a bit, I found a few values of $k,p,q$ which solve the equation and are not of the given form:

4 34 44

12 38 51

16 126 163

18 16 24

60 50 75

67 92 131

What can we say about the solutions which are not of that form? Are there infinitely many? Is there another form?

share|cite|improve this question
The family you mention is the case where there are one more square on the left than on the right. Maybe try for two more, or three more, etc. I also noticed in two of the exceptional cases we have $(p,q)=(2t,3t)$ which may give another family. – coffeemath Jul 5 '13 at 17:33
Define the pyramidal numbers $$P(n)=1^2+2^2+\cdots+n^2={n(n+1)(2n+1)\over6}$$ Then your left side is $P(k+p)-P(k-1)$, right side is $P(k+q)-P(k+p)$, so you are looking for solutions to $2P(r)=P(s)+P(t)$. Not an answer, but maybe a neater way to pose the question, as each variable is on its own. – Gerry Myerson Jul 6 '13 at 1:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.