Maths Olympiad Prep

Library / /413 of 520

Number theory Difficulty 6.0 National olympiad Prove it

Mr. Precise wants to take his teacup out of the microwave exactly in front. However, Mr. Precise's microwave is not willing to cooperate so precisely.

To be more precise, the two are playing the following game:

Let n be a positive integer. The turntable of the microwave makes one complete rotation in n seconds. When the microwave is turned on, an integer number of seconds is either turned clockwise or counterclockwise, so there are n possible positions where the teacup can stop. One of these positions is exactly in front.

At the beginning, the microwave rotates the teacup to one of the n possible positions. Then, in each move, Mr. Precise enters an integer number of seconds, and the microwave decides to rotate either clockwise or counterclockwise for this number of seconds.

For which n can Mr. Precise enforce taking the teacup out of the microwave exactly in front after a finite number of moves?

(Birgit Vera Schmidt)

Answer. Mr. Precise can enforce a win exactly when nn is a power of two.

Solution

Derivation.

We approach the game in reverse and first consider how a situation could look from which Mr. Precise can win in a single move. This is actually only possible if the teacup is exactly opposite the microwave door, i.e., "at the back," which is only possible at all for even nn. In this case, Mr. Precise enters n/2n/2 seconds, and the microwave has no choice but to turn the cup either clockwise or counterclockwise to "front."

We "see" that from all other positions, the microwave always has at least one option to not turn the cup to "front," but we will deal with this in more detail later.

To prevent the microwave from winning, it must avoid placing the cup at the "front" or "back" positions at any time.

We take another step back and consider how Mr. Precise could force the microwave to do exactly that. This is certainly possible when the teacup is exactly between these two positions, i.e., at n/4n/4 or 3n/43n/4, if we label the positions clockwise with the numbers from 1 to nn, such that nn is "front." In this case (which can only occur if nn is divisible by 4), Mr. Precise enters n/4n/4, which forces the microwave to either place the cup at "front" and immediately lose, or place it at "back" and lose one move later.

We suspect again that for all positions other than these four, the microwave always has the option to not place the cup at "front" or "back," but we defer the proof to later.

We take another step back and see that Mr. Precise can achieve this from the positions n/8,3n/8,5n/8,n/8, 3n/8, 5n/8, and 7n/87n/8 (if these are integers, i.e., if nn is divisible by 8) by entering n/8n/8 each time, and again land on one of the four positions from which we already know the winning strategy.

This can be continued: Let kk be the largest natural number such that 2k2^k is a divisor of nn, i.e., nn has the form n=m2kn = m \cdot 2^k with a suitable odd positive integer mm. Then Mr. Precise can use the described winning strategy from all positions of the form

an2k=am a \cdot \frac{n}{2^k} = a \cdot m

with a positive integer 1a2k1 \leq a \leq 2^k. In the case where nn is a power of two (i.e., m=1m=1), these are all nn positions, so Mr. Precise can always enforce a win for such nn.

We now suspect that for every nn that is not a pure power of two (i.e., m>1m>1), the microwave can prevent a win. We already know that it must avoid all positions that can be represented as in (2), i.e., those divisible by mm. It is also sufficient to show that from every position that is not divisible by mm, at least one of the two rotation directions leads to a position that is not divisible by mm. This, in particular, also avoids "front" =n=2km= n = 2^k \cdot m permanently, preventing Mr. Precise from winning. This claim can be quickly shown with modulo considerations, which we will write down neatly in the following.

Since we do not want to give Mr. Precise and the microwave the entire derivation as game instructions, we will now write down the respective strategies concretely:

## Strategy.

The positions are labeled from 1 to nn, and the "front" position has the number nn.

In the case n=1n=1, there is only the "front" position, so Mr. Precise always wins.

Let nn be a power of two. If the teacup is initially on an odd position, Mr. Precise enters one second, which ensures that the teacup will be on an even position regardless of the rotation direction. (If the teacup is already on an even position, he skips this step.)

If the teacup is now at a position divisible by 2 but not by 4, he enters 2, otherwise he skips this step again.

Thus, he can enforce that after at most \ell moves, the teacup will be at a position divisible by 22^\ell (by entering 212^{\ell-1} in the \ell-th move or doing nothing, depending on whether the current position is already divisible by 22^\ell or not).

Now let nn not be a power of two, i.e., nn has the form n=m2kn = m \cdot 2^k, where m>1m>1 is a suitable odd integer. The microwave can now prevent the current position from ever being congruent to 0 modulo mm. To do this, it initially turns the teacup to position 1 (or any other position not divisible by mm).

Thereafter, in each move, it has the option to turn the teacup from the current position aa to either a+ba+b or aba-b modulo nn (where bb is the number of seconds entered by Mr. Precise). Suppose both were divisible by mm, then their difference 2b2b would also be divisible by mm. Since mm is odd, bb would also be divisible by mm. But then (ab)+b=a(a-b)+b=a would also be divisible by mm, contradicting the fact that the teacup was on a position not divisible by mm at the beginning of the move. Therefore, the microwave has at least one option in each move that is not divisible by mm (and thus in particular not the number nn itself).

(Birgit Vera Schmidt)

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

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