Problem

Source: 2024 Portuguese MO Day 2 P6

Tags: Game Theory, combinatorics



Alexandre and Bernado are playing the following game. At the beginning, there are $n$ balls in a bag. At first turn, Alexandre can take one ball from the bag; at second turn, Bernado can take one or two balls from the bag, and so on. So they take turns and in $k$ turn, they can take a number of balls from $1$ to $k$. Wins the one who makes the bag empty. For each value of $n$, find who has the winning strategy.