Browse · MathNet
PrintCroatia_2018
Croatia 2018 counting and probability
Problem
Two players alternately write one digit at a time, from left to right. A player loses if, after his move, there is a sequence of digits such that there exists a positive integer for which the number is a multiple of .
Which player can win regardless of how his opponent plays? (Russia 2003)
Which player can win regardless of how his opponent plays? (Russia 2003)
Solution
We will show that the second player can win regardless of the first player's actions. Obviously, none of the players will write in any step.
Notice that , so the following criterion for divisibility by holds: Denote by the remainder when dividing by , for . If, after the move, the numbers are pairwise distinct, then by the mentioned criterion, in the next move we obtain the numbers which are also pairwise distinct since . Inductively, we conclude that after each step of the game (for ), the numbers are distinct. Because of the way in which transform at each move, we conclude that there are at most digits which, if the player writes them, will cause him to lose.
Assume that the game lasts for at least nine moves. The second player loses if and only if, after the ninth move, the set is , i.e. the second player wins if and only if is among the numbers .
If, after the eighth move, lacks two numbers between and which are not consecutive, then, no matter what the first player chooses in the ninth move, one of the numbers must be . Namely, if the first player chooses , then there is such that (in eighth move). Hence, after the ninth move we obtain Let us show that the second player can ensure that after the eighth move, among the numbers there are no two consecutive numbers. Certainly, the second player can ensure that the game lasts at least seven moves. Let If among the numbers , and there are no consecutive ones, then the second player can choose any of them. If , then the second player can write one of the numbers or so that, after the eighth move, there are two consecutive numbers missing from . Namely, if , the second player writes , and if , the second player writes .
Notice that , so the following criterion for divisibility by holds: Denote by the remainder when dividing by , for . If, after the move, the numbers are pairwise distinct, then by the mentioned criterion, in the next move we obtain the numbers which are also pairwise distinct since . Inductively, we conclude that after each step of the game (for ), the numbers are distinct. Because of the way in which transform at each move, we conclude that there are at most digits which, if the player writes them, will cause him to lose.
Assume that the game lasts for at least nine moves. The second player loses if and only if, after the ninth move, the set is , i.e. the second player wins if and only if is among the numbers .
If, after the eighth move, lacks two numbers between and which are not consecutive, then, no matter what the first player chooses in the ninth move, one of the numbers must be . Namely, if the first player chooses , then there is such that (in eighth move). Hence, after the ninth move we obtain Let us show that the second player can ensure that after the eighth move, among the numbers there are no two consecutive numbers. Certainly, the second player can ensure that the game lasts at least seven moves. Let If among the numbers , and there are no consecutive ones, then the second player can choose any of them. If , then the second player can write one of the numbers or so that, after the eighth move, there are two consecutive numbers missing from . Namely, if , the second player writes , and if , the second player writes .
Final answer
Second player
Techniques
Games / greedy algorithmsInvariants / monovariantsModular Arithmetic