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.
Problem
Source: Irmo 2018 p1 q1
Tags: game strategy, game, number theory, minimum
16.09.2018 14:26
The answer is 2022. We look to the changing of this number on mod 2018 and see that it can't be congruent to 0,1,2 or 3 every other is O.K. so the smallest number greater than 2017 that is not congruent 0,1,2 or 3 on mod 2018 is 2022
29.04.2021 21:48
Why is it that a number not congruent to 0, 1, 2, or 3 on mod 2018 will yield a multiple of 2018? And why do numbers congruent to 4 on mod 2018?
30.04.2021 02:29
@above If we let $N$ denote the starting integer, clearly $N \not\equiv 0\pmod{2018}$. The new integer after Mary's first turn will be $-N+2 \pmod{2018}$, so clearly $N\not\equiv2 \pmod{2018}$. After Pat's first turn, we have the new integer to be $-N+3 \pmod{2018}$, so $N\not\equiv3\pmod{2018}$. Then after Mary's turn we will have the new integer to be $N-3+2 \equiv N-1 \pmod{2018}$, meaning $N \not\equiv 1\pmod{2018}$. After Pat's turn $N-1 + 1 \equiv N \pmod{2018}$ and we are back at the same residue as the initial integer. So the smallest residue mod $2018$ that will work for a $N$ such that Mary will prevent Pat from winning is $4$, this implies the answer to be $2022$.