Skip to main content

2024 AIME I Problem 3

Problem 3 of 15EasierNumber TheoryCombinatoricsProblem-Solving Techniques

Alice and Bob play the following game. A stack of nn tokens lies before them. The players take turns with Alice going first. On each turn, the player removes 11 token or 44 tokens from the stack. The player who removes the last token wins. Find the number of positive integers nn less than or equal to 20242024 such that there is a strategy that guarantees that Bob wins, regardless of Alice’s moves.

Your answer

Integer from 0 to 999
Show solution

Solution

Call nn a losing position if the player about to move loses with best play. We claim the losing positions are exactly n≡0n \equiv 0 or 2(mod5).2 \pmod 5. From such an n,n, removing 11 or 44 tokens leaves n≡4,1,3(mod5)n \equiv 4, 1, 3 \pmod 5 — never again 00 or 22 — while from any n≡1,3,4(mod5)n \equiv 1, 3, 4 \pmod 5 one move reaches a position ≡0\equiv 0 or 2(mod5)2 \pmod 5 (remove 1,1, 1,1, 44 tokens respectively). Since n=0n = 0 is a loss for the player to move, induction confirms the pattern. Bob wins exactly when nn is a losing position for Alice. Among 1≤n≤20241 \le n \le 2024 there are 404404 multiples of 55 and 405405 values n≡2(mod5)n \equiv 2 \pmod 5 (from 22 to 20222022), for a total of 404+405=809.404 + 405 = 809.
AoPS wiki

Tagged: combinatorial game · modular arithmetic · small cases

More practice