Olympiad Maths Prep

Library / /30 of 30

Combinatorics Difficulty 7.4 National olympiad, round 2 Prove it Belarus

There is a heap of 360360 stones. Nick and Mary play the following game. They, in turn (Mary is the first), remove the stones from the heap. Per move it is allowed to remove exactly 11 or exactly mm or exactly nn stones. The player wins if he/she removes the last stone. Before the start Nick fixes the value of nn (2n92 \le n \le 9). After that Mary fixes the value of mm (mn,2m9m \ne n, 2 \le m \le 9) and begins the game.
Can somebody of the players fix his/her number to win if both of them play to win?
(V. Kaskevich)

Solution

Nick wins if he sets n=2n = 2. We consider all possibilities for mm. Let m=3m = 3. If Mary removes kk stones then Nick removes 4k4 - k. In this case exactly 44 stones are removed from the heap after each pair of moves (Mary - Nick). Since 360:4360 : 4, Nick wins.

Now we will solve the problem moving backward. We write all numbers from 11 to 360360 and mark them with "+" or "-". If kk stones remain in the heap before the move of a player and he/she can win, then we write +k+k, otherwise we write k-k. For m=4,5,7,8m = 4, 5, 7, 8 we have the following table

| +1 | +2 | -3 | +4 | +5 | -6 | +7 | +8 | -9 | +10 | +11 | -12 | +13 | +14 | -15 | +16 | ... |

We see that the signs in the table are repeated with the period equaled 33 (it is easy to prove by induction).
Since 360:3360 : 3 it follows that 360360 is marked with the sign "-". Thus the number 360360 is the losing number of the stones for the beginning player.

For m=6m = 6 we have the table

| +1 | +2 | -3 | +4 | +5 | +6 | -7 | +8 | +9 | -10 | +11 | +12 | +13 | -14 | ... |
| 1 | 2 | - | 1 | 2 | 6 | - | 1 | 2 | - | 1 | 2 | 6 | - | ... |

The second row of the table contains the possible winning moves (to win the player can remove so many stones that after his move the number of the stones remained in the heap would be marked with "+"). We see that the signs in the first row of the table are repeated with the period equaled 77 (it is easy to prove by induction).
Since 360360 is congruent to 33 modulo 77, it follows that 360360 and 33 are marked with the same sign, i.e. "-". Thus the number 360360 is the losing number of the stones for the beginning player. To win Nick can remove so many stones as it is written in the second row of the table.

In a similar way, for m=9m = 9 we have the table

| +1 | +2 | -3 | +4 | +5 | -6 | +7 | +8 | +9 | -10 |
| 1 | 2 | - | 1 | 2 | - | 1 | 2 | 9 | - |

| +11 | +12 | -13 | +14 | +15 | -16 | +17 | +18 | +19 | -20 | ... |
| 1 | 2 | - | 1 | 2 | - | 1 | 2 | 9 | - | ... |

The second row of the table contains the possible winning moves (to win the player can remove so many stones that after his move the number of the stones remained in the heap would be marked with "+"). We see that the signs in the first row of the table are repeated with the period equaled 1010 (it is easy to prove by induction).
Since 360360 is divided by 1010, it follows that 360360 and 1010 are marked with the same sign, i.e. "-". Thus the number 360360 is the losing number of the stones for the beginning player. To win Nick can remove so many stones as it is written in the second row of the table.

Looking for a route rather than an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.