Problem

Source: Austrian Mathematics Olympiad Regional Competition (Qualifying Round) 2017, Problem 3

Tags: combinatorics, Austria, AUT



The nonnegative integers $2000$, $17$ and $n$ are written on the blackboard. Alice and Bob play the following game: Alice begins, then they play in turns. A move consists in replacing one of the three numbers by the absolute difference of the other two. No moves are allowed, where all three numbers remain unchanged. The player who is in turn and cannot make an allowed move loses the game. Prove that the game will end for every number $n$. Who wins the game in the case $n = 2017$? Proposed by Richard Henner