Source: USAMO-2023-P4
Category: Operations and Strategies

Problem:
Positive integers $a$ and $N$ are fixed, and $N$ positive integers are written on a blackboard. Alice and Bob play the following game. On Alice's turn, she must replace some integer $n$ on the board with $n+a$, and on Bob's turn he must replace some even integer $n$ on the board with $n/2$. Alice goes first and they alternate turns. If on his turn Bob has no valid moves, the game ends.

After analyzing the $N$ integers on the board, Bob realizes that, regardless of what moves Alice makes, he will be able to force the game to end eventually. Show that, in fact, for this value of $a$ and these $N$ integers on the board, the game is guaranteed to end regardless of Alice's or Bob's moves.

Solution:
For $N=1$, neither player has a choice of which number to operate on: Alice must add $a$ to the single number on the board, and Bob must halve it if it is even. Thus, the sequence of moves is uniquely determined, and any outcome that occurs "regardless of what moves Alice makes" trivially occurs "regardless of Alice's or Bob's moves." There is nothing further to prove in this case, so we address $N \ge 2$ henceforth. 

Let $S$ denote the multiset of numbers on the board. We consider two cases based on the 2-adic valuations $\nu_2(x)$ of the numbers $x \in S$.

**Case 1:** $\nu_2(x) < \nu_2(a)$ for all $x \in S$.
In this case, the game must terminate no matter what either player does. 
*Proof:* On Alice's turn, she replaces some $x$ with $x+a$. Since $\nu_2(x) < \nu_2(a)$, the valuation of the new number is $\nu_2(x+a) = \min(\nu_2(x), \nu_2(a)) = \nu_2(x)$. Thus, the 2-adic valuation of every number on the board is unchanged by Alice's moves. On Bob's turn, he replaces some even $y$ with $y/2$, which decreases its 2-adic valuation by exactly one. The game ends when no even numbers remain (i.e., every $\nu_2$ is zero). Since the sum $\sum_{x \in S} \nu_2(x)$ decreases by one on each of Bob's turns and is invariant on Alice's turns, the game will always terminate in exactly $\sum_{x \in S} \nu_2(x)$ of Bob's moves, regardless of the choices made by either player.

**Case 2:** There exists at least one number $x \in S$ such that $\nu_2(x) \ge \nu_2(a)$.
In this case, Alice can cause the game to go on forever, which contradicts the premise that Bob can force the game to end.
*Proof:* Designate $x$ as the first entry on the board (its value will change over time, but we track this specific position). Alice's strategy is as follows:
- If $\nu_2(x) = \nu_2(a)$, she operates on the first entry, replacing it with $x+a$. Because $x$ and $a$ have the same 2-adic valuation, the new entry satisfies $\nu_2(x+a) > \nu_2(a)$.
- If $\nu_2(x) > \nu_2(a)$, she operates on any entry besides the first one. This is always possible since $N \ge 2$. The value of $x$ remains unchanged, so $\nu_2(x) > \nu_2(a)$ still holds.

A double induction shows that this strategy maintains the following invariants: just before each of Bob's turns, $\nu_2(x) > \nu_2(a)$ holds; and after each of Bob's turns, $\nu_2(x) \ge \nu_2(a)$ holds. 
- *Before Bob's turn:* At the start of Alice's turn, we assume $\nu_2(x) \ge \nu_2(a)$ (which is true initially). Following her strategy, whether she adds $a$ to $x$ or to another number, the resulting value of $x$ will satisfy $\nu_2(x) > \nu_2(a)$. Thus, the condition holds just before Bob's turn.
- *After Bob's turn:* Bob must halve some even number. If he chooses to halve $x$, its new valuation becomes $\nu_2(x) - 1$. Since it was strictly greater than $\nu_2(a)$ before his turn, it is now at least $\nu_2(a)$. If he halves any other number, $x$ is unchanged, so $\nu_2(x) > \nu_2(a) \ge \nu_2(a)$. In either scenario, $\nu_2(x) \ge \nu_2(a)$ holds after his turn.

Because $\nu_2(x) > \nu_2(a) \ge 0$ just before each of Bob's turns, $x$ is always strictly even when it is Bob's turn. In particular, Bob will never run out of legal moves, since halving $x$ is always legal. Thus, the game continues indefinitely.

Since Case 2 allows Alice to force an infinite game, it contradicts the given condition that Bob can force the game to end. Therefore, Case 1 must hold, and the game is guaranteed to end regardless of either player's moves.


Grading guidelines:
(Partial) 1. Introduced the 2-adic valuation \(\nu_2\) and proved the key fact: if \(\nu_2(x)<\nu_2(a)\), then \(\nu_2(x+a)=\nu_2(x)\). 2. In the regime \(\nu_2(x)<\nu_2(a)\) for all board entries, defined a monovariant such as \(\sum_{x\in S}\nu_2(x)\) and showed it decreases by exactly 1 on each of Bob’s moves and is unchanged on Alice’s moves, implying termination. 3. In the regime where some entry satisfies \(\nu_2(x)\ge \nu_2(a)\), gave a correct construction/strategy idea for Alice to keep at least one always-even number available for Bob (e.g. track one fixed position and try to keep its \(\nu_2\) large), even if not fully justified. (Almost) 1. Correctly split into the two valuation cases and proved Case 1 (all \(\nu_2(x)<\nu_2(a)\)) implies the game ends regardless of play, but did not clearly explain why this is the only possible case under the hypothesis. 2. Correctly described Alice’s infinite-play strategy in Case 2 and argued Bob always has a move, but left a localized gap in the induction/invariants (e.g. why \(\nu_2(x+a)>\nu_2(a)\) when \(\nu_2(x)=\nu_2(a)\), or why Alice can always play off the tracked entry when needed). 3. Solution is almost complete, but made minor mistakes which are not negligible.