Skip to main content
OlympiadHQ

Browse · MathNet

Print

Iranian Mathematical Olympiad

Iran counting and probability

Problem

Let , and be arbitrary positive integers. Ali and Mohammad play the following game: At each step, Ali chooses , then Mohammad chooses a positive integer and obtains a new sequence , where Through a finite number of steps, Ali intends to make all the numbers divisible by . Find all positive integers and such that Ali, independent of the initial values , has a winning strategy.
Solution
We claim that the second player has a winning strategy for where is a prime number and . We call a pair a good pair if the second player has a winning strategy.

Lemma 1. If is a good pair and then is also a good pair.

Proof. Assume that the game starts with the sequence . Mohammad considers a second game that starts with the sequence where and , for . Now if Ali chooses in the first game, Mohammad assumes that Ali chooses in the second game and follows his strategy and wins the second game. But the first game is just a restriction of the second game to the components so he can also win the first game.

Lemma 2. is a good pair if and only if and are also good pairs.

Proof. If is a good pair then it is clear that and are good pairs. Now if and are good pairs, starting with a sequence then using the aforementioned strategy for , making all the components divisible by . Considering the sequence , applying the preceding strategy for to ensure that , by the very end all the terms are divisible by and hence is a good pair.

By these lemmas we see that if is a good pair and , then is also a good pair. Now by the next lemma we would obtain . Hence should be of the form .

Lemma 3. If is a good pair and then .

Proof. Assume that . Consider one step before the end of the game. The sequence must be constant; otherwise for each sequence there is some such that and the first player can choose . In the second step before the last step, we should have otherwise Ali could choose a shift such that is not constant. So we must have , implying that . So the sequence is constant. We then use induction to deduce that the sequence should be constant from the starting point. So, for a non-constant sequence the first player has a winning strategy.

It remains to prove that is a good pair. By the second lemma it suffices to prove that is a good pair. We claim that if the second player chooses at each step, he shall win. There are two ways to do this:

First proof. Let denote a shift by 1. Then at each step the sequence changes to . It suffices to prove that but . So it is enough to prove but

Second proof.

Lemma 4. There is an integer-valued polynomial such that for all .

Proof. Consider the polynomial . One can see that and for , we have . Then we can choose Now, in the next step we have but the degree of is less than so after steps the second player wins.
Final answer
Exactly those pairs where both numbers are powers of the same prime; that is, m = p^alpha and n = p^beta for some prime p and nonnegative integers alpha and beta.

Techniques

Games / greedy algorithmsPolynomials mod pPolynomial interpolation: Newton, LagrangeLinear transformationsVectors