Problem

Source: Indonesian National Science Olympiad 2018, Mathematics P7

Tags: combinatorics



Suppose there are three empty buckets and $n \ge 3$ marbles. Ani and Budi play a game. For the first turn, Ani distributes all the marbles into the buckets so that each bucket has at least one marble. Then Budi and Ani alternate turns, starting with Budi. On a turn, the current player may choose a bucket and take 1, 2, or 3 marbles from it. The player that takes the last marble wins. Find all $n$ such that Ani has a winning strategy, including what Ani's first move (distributing the marbles) should be for these $n$.