# IMO 2021 Q1 #

Let `n ≥ 100`

be an integer. Ivan writes the numbers `n, n+1, ..., 2*n`

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 show there exists a triplet `a, b, c ∈ [n , 2n]`

with `a < b < c`

and each of the sums `(a + b)`

,
`(b + c)`

, `(a + c)`

being a perfect square. Specifically, we consider the linear system of
equations

```
a + b = (2 * l - 1) ^ 2
a + c = (2 * l) ^ 2
b + c = (2 * l + 1) ^ 2
```

which can be solved to give

```
a = 2 * l ^ 2 - 4 * l
b = 2 * l ^ 2 + 1
c = 2 * l ^ 2 + 4 * l
```

Therefore, it is enough to show that there exists a natural number `l`

such that
`n ≤ 2 * l ^ 2 - 4 * l`

and `2 * l ^ 2 + 4 * l ≤ 2 * n`

for `n ≥ 100`

.

Then, by the Pigeonhole principle, at least two numbers in the triplet must lie in the same pile, which finishes the proof.