Problem

Source: Irmo 2018 p1 q1

Tags: game strategy, game, number theory, minimum



Mary and Pat play the following number game. Mary picks an initial integer greater than $2017$. She then multiplies this number by $2017$ and adds $2$ to the result. Pat will add $2019$ to this new number and it will again be Mary’s turn. Both players will continue to take alternating turns. Mary will always multiply the current number by $2017$ and add $2$ to the result when it is her turn. Pat will always add $2019$ to the current number when it is his turn. Pat wins if any of the numbers obtained by either player is divisible by $2018$. Mary wants to prevent Pat from winning the game. Determine, with proof, the smallest initial integer Mary could choose in order to achieve this.