Problem

Source: 2022 Brazilian National Mathematical Olympiad - Problem 1

Tags: combinatorics, game, Process, invariant



A single player game has the following rules: initially, there are $10$ piles of stones with $1,2,...,10$ stones, respectively. A movement consists on making one of the following operations: i) to choose $2$ piles, both of them with at least $2$ stones, combine them and then add $2$ stones to the new pile; ii) to choose a pile with at least $4$ stones, remove $2$ stones from it, and then split it into two piles with amount of piles to be chosen by the player. The game continues until is not possible to make an operation. Show that the number of piles with one stone in the end of the game is always the same, no matter how the movements are made.