Problem

Source: Centroamerican 2020, problem 2

Tags: combinatorics, Combinatorial games



Suppose you have identical coins distributed in several piles with one or more coins in each pile. An action consists of taking two piles, which have an even total of coins among them, and redistribute their coins in two piles so that they end up with the same number of coins. A distribution is levelable if it is possible, by means of 0 or more operations, to end up with all the piles having the same number of coins. Determine all positive integers $n$ such that, for all positive integers $k$, any distribution of $nk$ coins in $n$ piles is levelable.