Problem

Source: IMOC 2023 C6

Tags: combinatorics



Given integer $n \geq 3$. $1, 2, \ldots, n$ were written on the blackboard. In each move, one could choose two numbers $x, y$, erase them, and write down $x + y, |x-y|$ in the place of $x, y$. Find all integers $X$ such that one could turn all numbers into $X$ within a finite number of moves.