Source: IMO-2021-P1
Category: Graph Theory

Problem:
Let $n \ge 100$ be an integer. Ivan writes the numbers $n, n+1, \dots, 2n$ each on different cards. He then shuffles these $n+1$ cards, and divides them into two piles. Prove that at least one of the piles contains two cards such that the sum of their numbers is a perfect square.

Solution:
We will find three cards $a<b<c$ such that the sum of any two is a perfect square. By the Pigeonhole Principle, if these three cards are divided into two piles, at least one pile must contain two of them, yielding a pair whose sum is a perfect square. 

We look for $a, b, c$ such that
\[
b+c=(2k+1)^2,\qquad
c+a=(2k)^2,\qquad
a+b=(2k-1)^2
\]
for some integer $k$. Solving the system of equations for $a$, $b$, and $c$ gives
\[
a=\frac{(2k)^2+(2k-1)^2-(2k+1)^2}{2}=2k^{2}-4k,
\]
\[
b=\frac{(2k+1)^2+(2k-1)^2-(2k)^2}{2}=2k^{2}+1,
\]
\[
c=\frac{(2k+1)^2+(2k)^2-(2k-1)^2}{2}=2k^{2}+4k.
\]

We need to show that for any given integer $n\ge 100$, one can find a suitable $k$ such that the cards $a, b, c$ are drawn from the available numbers $\{n, n+1, \dots, 2n\}$. This requires $n \le a < b < c \le 2n$. Let
\[
I_k\coloneq\{\,n\in\mathbb Z\mid n\le a<b<c\le 2n\,\}
\]
be the set of valid integers $n$ for a given $k$. Since $a < b < c$ holds for all $k \ge 2$, the condition $n \le a$ requires $n \le 2k^2 - 4k$, and the condition $c \le 2n$ requires $2k^2 + 4k \le 2n$, which simplifies to $k^2 + 2k \le n$. Thus, the interval is
\[
I_k = \{\,n\in\mathbb Z\mid k^{2}+2k\le n\le 2k^{2}-4k\,\}.
\]
When $n\in I_k$, the problem is solved for that choice of $k$. It is therefore sufficient to show that the union of these intervals $I_k$ covers all integers $n \ge 100$. 

Starting with $k=9$, we have $k^2+2k = 99$ and $2k^2-4k = 126$, so
\[
I_{9}=\{\,n\in\mathbb Z \mid 99\le n\le 126\,\}.
\]
For the intervals to overlap and cover all subsequent integers, the right endpoint of $I_k$ must be greater than or equal to the left endpoint of $I_{k+1}$ minus $1$. In fact, we can show a stronger inequality for $k \ge 9$:
\[
2k^{2}-4k\ge (k+1)^{2}+2(k+1).
\]
Expanding the right side gives $k^2 + 4k + 3$. The inequality rearranges to
\[
k^2 - 8k - 3 \ge 0,
\]
which is clearly true for $k \ge 9$ since $9^2 - 8(9) - 3 = 6 \ge 0$, and the quadratic is increasing for $k \ge 4$. 

This confirms that the right endpoint of $I_k$ strictly exceeds the left endpoint of $I_{k+1}$ for all $k \ge 9$. Since $I_9$ begins at $99$, the intervals $I_k$ for $k \ge 9$ collectively cover all integers $n \ge 99$. Hence, for any $n\ge 100$, a suitable $k$ exists, and the statement holds.


Grading guidelines:
(Partial) 1. Reduced the problem to finding three numbers a<b<c in {n,n+1,…,2n} such that at least two of them lie in the same pile (pigeonhole), and stated that it suffices to have at least one pair among {a,b,c} with square sum. 2. Constructed (or correctly derived) a triple a,b,c with all pairwise sums being consecutive odd/even squares, e.g. a=2k^2−4k, b=2k^2+1, c=2k^2+4k, and checked that a+b, a+c, b+c are perfect squares. 3. Obtained correct inequality conditions on k ensuring a,b,c all lie in [n,2n] (typically n≤a and c≤2n, equivalent to n≤2k^2−4k and k^2+2k≤n), even if the coverage for all n≥100 is not finished. (Almost) 1. Found a valid k for each n≥100 via the interval method Ik={n: k^2+2k≤n≤2k^2−4k}, but left a small gap in proving that the intervals Ik overlap/cover all integers n≥100 (e.g. the inequality 2k^2−4k≥(k+1)^2+2(k+1) not fully justified or the starting k not checked carefully). 2. Completed the construction of a,b,c and the pigeonhole step, and correctly argued existence of k for all n≥100, but made a localized algebraic slip in computing a,b,c or in one endpoint inequality while the intended interval-covering argument is clear and otherwise correct. 3. Solution is almost complete, but made minor mistakes which are not negligible.