Kvant Math Problem 66
Consider the examples given: $3^2 + 4^2 = 5^2$, $36^2 + 37^2 + 38^2 + 39^2 + 40^2 = 41^2 + 42^2 + 43^2 + 44^2$, and $55^2 + 56^2 + 57^2 + 58^2 + 59^2 + 60^2 = 61^2 + 62^2 + 63^2 + 64^2 + 65^2$.
Verified: no
Verdicts: SKIP + SKIP
Solve time: 4m57s
Source on kvant.digital
Problem
Here are a few examples where the sum of the squares of $k$ consecutive natural numbers equals the sum of the squares of the next $k-1$ natural numbers: $$\begin{gathered} 3^2+4^2=5^2,\ 36^2+37^2+38^2+39^2+40^2=41^2+42^2+43^2+44^2,\ 55^2+56^2+57^2+58^2+59^2+60^2=61^2+62^2+63^2+64^2+65^2. \end{gathered}$$
Find a general formula that covers all such cases.
A. I. Milovanov
Exploration
Consider the examples given: $3^2 + 4^2 = 5^2$, $36^2 + 37^2 + 38^2 + 39^2 + 40^2 = 41^2 + 42^2 + 43^2 + 44^2$, and $55^2 + 56^2 + 57^2 + 58^2 + 59^2 + 60^2 = 61^2 + 62^2 + 63^2 + 64^2 + 65^2$. In each case, a sum of squares of $k$ consecutive integers equals the sum of squares of $k-1$ consecutive integers immediately following. Denote the first number of the left sum by $n$ and the number of terms by $k$. Then the right-hand sum begins with $n+k$. Denote the number of terms in the right sum by $k-1$. The equation becomes
$$n^2 + (n+1)^2 + \dots + (n+k-1)^2 = (n+k)^2 + (n+k+1)^2 + \dots + (n+2k-2)^2.$$
Expanding each sum using the formula for the sum of squares of consecutive integers, simplification reduces to a quadratic in $n$ and $k$. Testing small values suggests a linear relationship between $n$ and $k$, but larger examples indicate that the general solution involves finding integer solutions of a Diophantine equation. The challenge is to express $n$ and $k$ in a simple formula capturing all solutions.
Problem Understanding
The problem asks to find all sequences of consecutive natural numbers such that the sum of the squares of $k$ consecutive numbers equals the sum of the squares of the next $k-1$ numbers. This is a Type A problem: "Find all X." The core difficulty is translating the sum-of-squares condition into a solvable Diophantine equation and identifying a general formula that produces all solutions. Intuitively, the first number of the sequence grows roughly linearly with $k$, but the exact integer relationship must be determined.
Proof Architecture
Lemma 1: The sum of the squares of $m$ consecutive integers starting at $a$ is given by
$$\sum_{i=0}^{m-1} (a+i)^2 = m a^2 + m(m-1)a + \frac{m(m-1)(2m-1)}{6}.$$
Lemma 2: Equating the sum of squares of $k$ numbers starting at $n$ to the sum of squares of $k-1$ numbers starting at $n+k$ yields a quadratic in $n$, which can be solved explicitly for integer solutions.
Lemma 3: The general solution for integers $n$ and $k$ is
$$n = \frac{k(2k-1)}{2}, \quad \text{with } k \ge 2.$$
The hardest part is proving that this formula produces all solutions and that no other integer solutions exist, particularly because quadratic Diophantine equations can have hidden extraneous roots.
Solution
Let $n$ be the first number in the left-hand sum and $k$ the number of terms. The sum of squares of $k$ consecutive integers starting at $n$ is
$$\sum_{i=0}^{k-1} (n+i)^2 = k n^2 + n k(k-1) + \frac{k(k-1)(2k-1)}{6}.$$
The sum of squares of the next $k-1$ integers starting at $n+k$ is
$$\sum_{i=0}^{k-2} (n+k+i)^2 = (k-1)(n+k)^2 + (n+k)(k-1)(k-2) + \frac{(k-1)(k-2)(2k-3)}{6}.$$
Equating the two sums gives
$$k n^2 + k(k-1)n + \frac{k(k-1)(2k-1)}{6} = (k-1)(n+k)^2 + (k-1)(k-2)(n+k) + \frac{(k-1)(k-2)(2k-3)}{6}.$$
Expanding the right-hand side:
$$(k-1)(n+k)^2 = (k-1)(n^2 + 2kn + k^2) = (k-1)n^2 + 2k(k-1)n + k^2(k-1),$$
$$(k-1)(k-2)(n+k) = (k-1)(k-2)n + (k-1)(k-2)k = (k-1)(k-2)n + k(k-1)(k-2),$$
$$\frac{(k-1)(k-2)(2k-3)}{6} \text{ remains.}$$
Summing these terms:
$$(k-1)n^2 + [2k(k-1) + (k-1)(k-2)] n + k^2(k-1) + k(k-1)(k-2) + \frac{(k-1)(k-2)(2k-3)}{6}.$$
Simplify the coefficients:
$$n^2 + 3k - 2?? \text{Better to compute carefully: } 2k(k-1)+(k-1)(k-2)=2k^2-2k + k^2-3k +2 = 3k^2 -5k +2.$$
Similarly, constants: $k^2(k-1)+k(k-1)(k-2)+\frac{(k-1)(k-2)(2k-3)}{6}$.
Compute step by step:
- $k^2(k-1) = k^3 - k^2$.
- $k(k-1)(k-2) = k(k^2 -3k +2) = k^3 -3k^2 + 2k$.
- $\frac{(k-1)(k-2)(2k-3)}{6} = \frac{(2k^3 -7k^2 +11k -6)}{6} = \frac{1}{3} k^3 - \frac{7}{6} k^2 + \frac{11}{6} k -1$.
Sum constants: $(k^3 - k^2) + (k^3 -3k^2 +2k) + (\frac{1}{3} k^3 - \frac{7}{6} k^2 + \frac{11}{6} k -1) = \frac{7}{3} k^3 - \frac{25}{6} k^2 + \frac{23}{6} k -1$.
Left-hand side constants: $\frac{k(k-1)(2k-1)}{6} = \frac{2k^3 -3k^2 + k}{6} = \frac{1}{3} k^3 - \frac{1}{2} k^2 + \frac{1}{6} k$.
Coefficient of $n^2$: $k - (k-1) =1$. Coefficient of $n$: $k(k-1) - (3k^2 -5k +2) = k^2 - k - (3k^2 -5k +2) = -2k^2 +4k -2 = -2(k-1)^2$.
Constants: $\frac{1}{3} k^3 - \frac{1}{2} k^2 + \frac{1}{6} k - (\frac{7}{3} k^3 - \frac{25}{6} k^2 + \frac{23}{6} k -1) = -2 k^3 + 3 k^2 -3k +1 = -(2k-1)(k-1)^2$.
Thus, the quadratic equation reduces to
$$n^2 - 2(k-1)^2 n - (2k-1)(k-1)^2 =0.$$
Solve using the quadratic formula:
$$n = \frac{2(k-1)^2 \pm \sqrt{4(k-1)^4 + 4(2k-1)(k-1)^2}}{2} = (k-1)^2 \pm (k-1)\sqrt{(k-1)^2 + 2k -1}.$$
Simplify the square root: $(k-1)^2 + 2k -1 = k^2$.
Hence, $\sqrt{k^2} = k$, so
$$n = (k-1)^2 \pm k(k-1) = (k-1)^2 + k(k-1) = (k-1)(k-1+k) = (k-1)(2k-1),$$
or $n = (k-1)^2 - k(k-1) = (k-1)(k-1 - k) = -(k-1)$, which is negative and not a natural number.
Therefore, the only natural solution is
$$n = (k-1)(2k-1), \quad k \ge 2.$$
This produces all examples given: $k=2$ yields $