Olympiad Maths Prep

Track / Stage 5 / 323 of 400 #923 of 2000

Problem 923

AIME late
Number theory Difficulty 5.8 Find the answer

3. On the board, an integer is written. Two players AA and BB take turns, starting with AA. Each player, on their turn, replaces the existing number with the result of one of these two operations: subtract 1 or divide by 2, provided the result is a positive integer. The player who reaches the number 1 wins. Determine, with reasoning, the smallest even number that requires AA to play at least 2015 times to win (B's turns are not counted).

Official solution

Solution. If the initial value of NN is even, let's see that A wins: by either subtracting 1 or dividing by 2 (in the case N=4k+2,N2=2k+1N=4 k+2, \frac{N}{2}=2 k+1 odd), A will always leave B with an odd number, forcing B to subtract 1 as division by 2 is not possible, which means that when A plays again, they will encounter an even number, smaller than the previous one. Thus, A will eventually encounter a 2, and win.

It is important to note that when A has two valid options to leave B with an odd number, A will always prefer to divide by 2, to get closer to the goal more quickly.

Next, we will use the following result:

Let yy be an even number that A encounters on their turn. Then, two turns before, A was with a number greater than or equal to 2y+42 y+4.

Indeed, we will distinguish two cases: (1) Case y=4k+2y=4 k+2. It comes from a forced move of B from 4k+34 k+3. Before that, A could have been in 8k+68 k+6, or 4k+44 k+4 (this is viable, since from 4k+44 k+4 A cannot divide because 2k+22 k+2 is even). That is, B was in 8k+78 k+7 or 4k+54 k+5 before. If B was in 8k+78 k+7, A could have been in 16k+1416 k+14 or 8k+88 k+8, while if B was in 4k+54 k+5, A could only have been in 8k+108 k+10, not in 4k+64 k+6, because in that case A would have preferred to divide instead of subtracting. In summary, if y=4k+2y=4 k+2, two turns before, A could have been in 16k+14,8k+1016 k+14, 8 k+10 or 8k+88 k+8, with the smallest option being just 2y+42 y+4.

(2) Case y=4ky=4 k. Reasoning similarly, it is deduced that two turns before, A was in 8k+4(2y+4)8 k+4(2 y+4) or

The solution to the problem will be obtained by repeatedly applying the above result.

We define the sequence a0=2,an+1=2an+4a_{0}=2, a_{n+1}=2 a_{n}+4, whose explicit formula is

an=62n4 a_{n}=6 \cdot 2^{n}-4

By repeatedly applying the result, we see that for all nn, any NN from which one can reach 2 in 2n2 n turns must satisfy NanN \geq a_{n}. That is, counting that A goes from 2 to 1 in one turn, we have proved that for all nn, the numbers NN that require at least 2n+12 n+1 moves from A satisfy NanN \geq a_{n}.

Since for n=1007n=1007 we have 2n+1=20152 n+1=2015, it follows that NN is greater than or equal to the term a1007a_{1007} of the considered sequence, that is, the number 62100746 \cdot 2^{1007}-4. It remains to prove that equality can be achieved. For this, it is enough to see that for all n1n \geq 1, if A encounters ana_{n}, after two turns they will be in an1a_{n-1}. Indeed,

62n4anA62n5B62n6A32n3B32n4=62n14an1 \underbrace{6 \cdot 2^{n}-4}_{a_{n}} \xrightarrow{A} 6 \cdot 2^{n}-5 \xrightarrow{B} 6 \cdot 2^{n}-6 \xrightarrow{A} 3 \cdot 2^{n}-3 \xrightarrow{B} 3 \cdot 2^{n}-4=\underbrace{6 \cdot 2^{n-1}-4}_{a_{n-1}}

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.