Kvant Math Problem 2842

Let $a, a+1, \dots, a+n-1$ be $n>1$ consecutive natural numbers.

Verified: no
Verdicts: PASS + FAIL
Solve time: 38m17s
Source on kvant.digital

Problem

Several consecutive natural numbers (more than one) were written on the board. Could it happen that both the sum of all the even written numbers is equal to the square of a natural number, and the sum of all the odd written numbers is also equal to the square of a natural number?

A. Kuznetsov

Euler Olympiad (XVII, regional stage)

Exploration

Let $a, a+1, \dots, a+n-1$ be $n>1$ consecutive natural numbers. Let $S_e$ denote the sum of the even numbers in this block and $S_o$ the sum of the odd numbers. The goal is to determine whether it is possible that both $S_e$ and $S_o$ are perfect squares.

The structure of the sequence depends on the parity of $n$. When $n=2m$, both parities occur equally often. When $n=2m+1$, one parity occurs exactly once more than the other. In both situations the sums of even and odd terms can be expressed explicitly using arithmetic progression formulas, which reduces the problem to Diophantine conditions on those expressions.

Problem Understanding

The problem asks for the existence of a block of consecutive integers of length greater than one such that both partial sums, restricted to even and odd entries respectively, are perfect squares. The structure forces both sums to be closely related, so the strategy is to express them in closed form and analyze divisibility and square conditions.

Proof Architecture

The proof splits into the cases $n=2m$ and $n=2m+1$. In each case, explicit formulas for $S_e$ and $S_o$ are derived. The resulting equations are transformed into constraints involving squares and divisibility. Each case is then reduced to impossibility using factorization properties of integers and coprimality arguments.

Solution

Even length $n=2m$

Assume $a$ is even; the opposite parity case is symmetric. The even numbers are $a, a+2, \dots, a+2(m-1)$ and the odd numbers are $a+1, a+3, \dots, a+2m-1$. Their sums are

$S_e = m(a+m-1), \quad S_o = m(a+m).$

Assume $S_e = s^2$ and $S_o = t^2$. Then

$t^2 - s^2 = m.$

Hence

$(t-s)(t+s)=m.$

From $S_e = m(a+m-1)$ we obtain $m \mid s^2$, so every prime dividing $m$ must appear in $s$ with at least half its exponent. Write

$m = u v^2,$

where $u$ is squarefree and $v \in \mathbb{N}$. The divisibility $m \mid s^2$ implies $u \mid s$, so $s = u k$. Substituting gives

$s^2 = u^2 k^2 = m(a+m-1) = u v^2 (a+m-1).$

Canceling $u$ yields

$u k^2 = v^2 (a+m-1).$

Since $u$ is squarefree, $u \mid v^2 (a+m-1)$ forces $u \mid (a+m-1)$. Write $a+m-1 = u t^2$. Then

$u k^2 = v^2 u t^2,$

so $k = v t$ and therefore

$s = u v t.$

Substituting into $S_e = s^2$ gives

$u v^2 (a+m-1) = u^2 v^2 t^2,$

hence $a+m-1 = u t^2$ and

$a = u t^2 - m + 1.$

Now compute $S_o$:

$S_o = m(a+m) = u v^2 (u t^2 + 1).$

Since $S_o$ is a perfect square and $v^2$ is already a square factor, we require

$u(u t^2 + 1) \text{ to be a perfect square}.$

The numbers $u$ and $u t^2 + 1$ are coprime, since their difference is $1$. Therefore each must be a perfect square. Because $u$ is squarefree, this forces $u=1$, so $m=v^2$ is a perfect square.

Then

$S_o = v^2(t^2+1).$

For this to be a square, $t^2+1$ must be a perfect square, so there exists $x$ such that

$x^2 - t^2 = 1.$

This implies $(x-t)(x+t)=1$, which has no solutions in natural numbers. Hence the case $n=2m$ is impossible.

Odd length $n=2m+1$

Let $x = a+m$. Then

$S_e = (m+1)x, \quad S_o = mx.$

Assume both are perfect squares:

$mx = t^2, \quad (m+1)x = s^2.$

Write $m = u v^2$, where $u$ is squarefree. From $mx=t^2$ we get

$u v^2 x = t^2,$

so $u \mid t^2$, hence $u \mid t$. Write $t = u k$. Substituting gives

$u v^2 x = u^2 k^2,$

so

$x = \frac{u k^2}{v^2}.$

Thus $v^2 \mid u k^2$. Since $u$ is squarefree, $v \mid k$, so $k = v c$ and

$x = u c^2.$

Now substitute into $(m+1)x = s^2$:

$(m+1) u c^2 = s^2.$

Because $\gcd(u, m+1)=1$, every prime factor of $u$ must appear in $s$, so $u \mid s$, and writing $s = u d$ gives

$(m+1)c^2 = u d^2.$

Since $c^2$ is a square, this implies $u \mid c^2$, hence $u=1$ because $u$ is squarefree. Therefore $m$ is a perfect square.

Then $mx=t^2$ becomes $m x = c^2$, with $m=v^2$, so

$v^2 x = c^2,$

hence $x$ is a square, $x = r^2$, and $c = v r$.

Substituting into $(m+1)x = s^2$ gives

$(v^2+1) r^2 = s^2,$

so $v^2+1$ must be a perfect square. This implies $p^2 - v^2 = 1$, hence

$(p-v)(p+v)=1,$

which is impossible in natural numbers.

Thus the case $n=2m+1$ is also impossible.

Conclusion

Both possible parity cases for the length $n>1$ lead to contradictions. Therefore there is no block of more than one consecutive natural numbers for which the sum of the even numbers and the sum of the odd numbers are both perfect squares.