DR.WANG Mathematics中文

2024 AIME I · Question 3

Counting & combinatorics · combinatorial game · modular arithmetic · small cases · number-theory · problem-solving

Problem outline

Players alternate removing either one or four tokens from one pile. The last move wins. For how many starting sizes 1≤n≤20241\le n\le2024 can the second player force a win?

Show answer and methods 1 methods

Answer

809

Method 1 Determine losing residues

With zero tokens the player to move loses. Claim the losing residues modulo 55 are 0,20,2. A move from either such residue leads to 1,31,3 or 44. From 11 or 33 remove one to reach 00 or 22; from 44 remove four to reach 00. These moves are legal even for the first block. Induction proves the claim.

The first 20202020 positive sizes contain 404404 full blocks, contributing 808808 losses. Of the last four sizes only 20222022 qualifies, giving 809809.

Source and attribution

The outline and worked methods on this page were prepared for DR.WANG Mathematics.

Original question (external)