Problem

Source: Centroamerican 2016, problem 4

Tags: games, number theory



The number "3" is written on a board. Ana and Bernardo take turns, starting with Ana, to play the following game. If the number written on the board is $n$, the player in his/her turn must replace it by an integer $m$ coprime with $n$ and such that $n<m<n^2$. The first player that reaches a number greater or equal than 2016 loses. Determine which of the players has a winning strategy and describe it.