Problem

Source: XII International Festival of Young Mathematicians Sozopol 2023, Theme for 10-12 grade

Tags: combinatorics



On the board, the numbers from $1$ to $n$ are written. Achka (A) and Bavachka (B) play the following game. First, A erases one number, then B erases two consecutive numbers, then A erases three consecutive numbers, and finally B erases four consecutive numbers. What is the smallest $n$ such that B can definitely make her moves, no matter how A plays?