Problem

Source: Pan-American Girls' Mathematical Olympiad 2021, P5

Tags: combinatorics, PAGMO



Celeste has an unlimited amount of each type of $n$ types of candy, numerated type 1, type 2, ... type n. Initially she takes $m>0$ candy pieces and places them in a row on a table. Then, she chooses one of the following operations (if available) and executes it: $1.$ She eats a candy of type $k$, and in its position in the row she places one candy type $k-1$ followed by one candy type $k+1$ (we consider type $n+1$ to be type 1, and type 0 to be type $n$). $2.$ She chooses two consecutive candies which are the same type, and eats them. Find all positive integers $n$ for which Celeste can leave the table empty for any value of $m$ and any configuration of candies on the table. $\textit{Proposed by Federico Bach and Santiago Rodriguez, Colombia}$