Problem

Source: Baltic Way 2018, Problem 10

Tags: combinatorics, sets of integers



The integers from $1$ to $n$ are written, one on each of $n$ cards. The first player removes one card. Then the second player removes two cards with consecutive integers. After that the first player removes three cards with consecutive integers. Finally, the second player removes four cards with consecutive integers. What is th smallest value of $n$ for which the second player can ensure that he competes both his moves?