Browse · MathNet
PrintSILK ROAD MATHEMATICAL COMPETITION
counting and probability
Problem
An odd integer is given. Initially, Basil chooses an even positive integer such that and tells it to Pete. Basil then writes down three integers on a blackboard. After that, Pete makes a sequence of moves. By a move, Pete can either add to one of the numbers on the blackboard, add to the second number, and subtract from the third number, or, conversely, subtract from one number on the blackboard, subtract from the second number, and add to the third one. At each move, Pete can independently choose which number on the blackboard is the first, the second, and the third. Pete wins if, after some moves, all three numbers on the blackboard are zero. For which Basil cannot prevent Pete's win?
Solution
Answer. for an integer and , where is an odd prime number (necessarily having remainder 2 when divided by 3).
We start with describing the set of pairs for which Pete can win.
Lemma. (a) If , then Pete cannot win. (b) If , then Pete can win.
Proof. (a) Set . Then we have and . This means that, on each move, all three numbers on the blackboard increased by modulo (or, conversely, decreased by modulo ). Hence, if the three numbers written by Basil are not all congruent modulo , then this property will be preserved during Pete's moves, so that they will never be all equal (so they will never become all zero).
(b) Let be three numbers on the blackboard at some moment. Then Pete can perform, by several moves, any of the following operations:
1. To yield numbers , , and . For this purpose, he can add to the first number and to the second number, and then subtract from the second number and from the first one.
2. To yield numbers , , and . For that, he can subtract from the first number and add to the second one, and then subtract from the first number and add to the second one.
3. To yield numbers , , . Indeed, since and are coprime, there exist positive integers and such that . Applying operation 1 times and operation 2 times, Pete gets the desired situation.
4. Pete can, by one move, either decrease the sum of all numbers by 1 (using the first described move) or increase that sum by 1 (using the second move).
Performing operations 3 and 4, Pete can reach his goal: first, using operation 4, he gets three numbers summing up to zero; then, using operation 3, he makes one number on the blackboard zero, and then another number becomes zero. Since the sum of numbers on the blackboard does not change during these operations, the third number also vanishes at the end.
Due to the lemma, an odd number satisfies the requirements if and only if the following condition holds:
() For every even , the numbers and are coprime.
Notice that Notice also that the number runs over all odd positive integers smaller than . Therefore, property () is equivalent to the fact that the number is coprime to any odd positive integer smaller than ; or, in other words, that has no odd divisors smaller than and greater than — let us call such divisors bad.
Notice that the number is even; then , where is a positive integer, and is an odd positive integer. If and , then is a bad divisor. If is composite, i.e., with , then is a bad divisor.
The remaining cases are (1) , and (2) and is a prime number. It is easy to see that, in both cases, has no bad divisors. Therefore, the desired cases are precisely and , where is a prime. Checking modulo 3 it follows that is even in the former case, and has a remainder 2 when divided by 3 in the latter. The result follows.
We start with describing the set of pairs for which Pete can win.
Lemma. (a) If , then Pete cannot win. (b) If , then Pete can win.
Proof. (a) Set . Then we have and . This means that, on each move, all three numbers on the blackboard increased by modulo (or, conversely, decreased by modulo ). Hence, if the three numbers written by Basil are not all congruent modulo , then this property will be preserved during Pete's moves, so that they will never be all equal (so they will never become all zero).
(b) Let be three numbers on the blackboard at some moment. Then Pete can perform, by several moves, any of the following operations:
1. To yield numbers , , and . For this purpose, he can add to the first number and to the second number, and then subtract from the second number and from the first one.
2. To yield numbers , , and . For that, he can subtract from the first number and add to the second one, and then subtract from the first number and add to the second one.
3. To yield numbers , , . Indeed, since and are coprime, there exist positive integers and such that . Applying operation 1 times and operation 2 times, Pete gets the desired situation.
4. Pete can, by one move, either decrease the sum of all numbers by 1 (using the first described move) or increase that sum by 1 (using the second move).
Performing operations 3 and 4, Pete can reach his goal: first, using operation 4, he gets three numbers summing up to zero; then, using operation 3, he makes one number on the blackboard zero, and then another number becomes zero. Since the sum of numbers on the blackboard does not change during these operations, the third number also vanishes at the end.
Due to the lemma, an odd number satisfies the requirements if and only if the following condition holds:
() For every even , the numbers and are coprime.
Notice that Notice also that the number runs over all odd positive integers smaller than . Therefore, property () is equivalent to the fact that the number is coprime to any odd positive integer smaller than ; or, in other words, that has no odd divisors smaller than and greater than — let us call such divisors bad.
Notice that the number is even; then , where is a positive integer, and is an odd positive integer. If and , then is a bad divisor. If is composite, i.e., with , then is a bad divisor.
The remaining cases are (1) , and (2) and is a prime number. It is easy to see that, in both cases, has no bad divisors. Therefore, the desired cases are precisely and , where is a prime. Checking modulo 3 it follows that is even in the former case, and has a remainder 2 when divided by 3 in the latter. The result follows.
Final answer
All odd a > 1 for which Basil cannot prevent Pete's win are a = (4^n − 1)/3 for an integer n > 1, and a = (2p − 1)/3 where p is an odd prime with p ≡ 2 (mod 3).
Techniques
Invariants / monovariantsGames / greedy algorithmsGreatest common divisors (gcd)Factorization techniquesPrime numbers