Skip to main content
OlympiadHQ

Browse · MathNet

Print

Croatian Mathematical Society Competitions

Croatia counting and probability

Problem

Rudi and Miljen take turns playing a game on a board. One move consists of selecting two relatively prime positive integers that are already written on the board, erasing them and replacing them with their sum. The player who cannot make a move loses. Rudi plays first. Prove that Miljen has a winning strategy if the initial numbers on the board are

a) 2019 ones

b) 2020 ones.
Solution
a) We claim that Miljen can play so that he leaves some odd number and ones on the board after each of his moves, i.e. before Rudi's move. In that case, after of Miljen's moves only the number is written on the board, so Rudi cannot make a move and Miljen wins.

In the beginning, the board can be described as above, with . Rudi can erase two ones and write number on the board. In that case, Miljen can erase and , which he can do since is odd, and write on the board, which leaves the board as described above.

In each subsequent turn, Rudi and Miljen can play as above and our claim holds. Alternatively, Rudi can erase and one of the ones, and write . Note that is even, so Rudi's move leaves an odd number of ones on the board. Miljen can now select and a one, and write , which again only leaves some odd number and ones on the board, as before.

b) In this case, Miljen uses the same strategy as in a), except when making the final move. Namely, after each of Miljen's moves an odd number and ones are written on the board. Note that now is odd. It remains to describe Miljen's last, i.e. his th move.

If after Rudi's th move the numbers on the board are , and , Miljen can erase the two ones, and replace them with . Rudi cannot make a move after that, since and are not relatively prime, and Miljen wins.

If after Rudi's th move the numbers on the board are , and , Miljen can erase and , and replace them with , which again leaves Rudi with and , and Miljen wins.

Techniques

Games / greedy algorithmsInvariants / monovariantsGreatest common divisors (gcd)