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
Problem
Source: Austrian Mathematics Olympiad Regional Competition (Qualifying Round) 2017, Problem 3
Tags: combinatorics, Austria, AUT
13.06.2018 05:38
(Solution copied from this thread https://artofproblemsolving.com/community/u404977h1657134p10507651 under request of admin) Part 1: Suppose we start with ${a_1,b_1,c_1}$, and on the $n$-th turn, we have ${a_n, b_n, c_n}$. It is sufficient to notice that $max({a_n,b_n, c_n}) \geq max({a_{n+1},b_{n+1},c_{n+1}})$. The above follows from the following two observations: 1. if the integer we replace is the largest in the set, then we will be replacing it with the difference of the other two, which must be a smaller non-negative integer (or equal, but only in the case we have $(a, a, 0)$, in which case there are no valid moves left to make). 2. if the integer we replace is not the largest in the set, then the max element will remain intact, as we will simply be replacing one of the elements with the difference between the largest element and some smaller non-negative integer, a difference which is at most equal to the largest element itself (with equality only in the case $(a, b, 0)$, which can be easily bashed). Thus after each iteration, the largest element will get smaller, or stay the same. However, it cannot stay the same an infinite number of times, as that would imply the maximum element of the set is never operated on (assuming it's distinct). And it is impossible to keep changing the numbers without ever operating on the largest element: Suppose WLOG the max is a. Then ${a,b,c} \rightarrow {a, b, a-b}$, the only element we can now operate on is a. Thus the maximum element of the set gradually gets smaller. And as it cannot get smaller forever, as we are dealing with non-negative integers, so we must reach a point where the process ends. Part 2: (bash bash bash) We start with $2017, 2000, 17$ Notice that the only valid move is replacing $2017$ with $1983$; otherwise, we would be replacing 17 with 17, or 2000 with 2000. So after one turn, we have $2000, 1983, 17$. But the situation now is identical, as the only valid move is replacing the biggest of these numbers with $1983-17$. This repeats itself. Each time there is only one valid move, as the absolute difference of the two larger numbers is 17, and the absolute difference of the largest number and the smallest number is the middle number, until we end up with the numbers $28, 11, 17$ after $1989/17=117$ turns. From here, the only valid move is to $6, 11, 17 \rightarrow 6, 11, 5\rightarrow6, 1, 5\rightarrow4, 1, 5\rightarrow4, 1, 3\rightarrow2, 1, 3\rightarrow2, 1, 1\rightarrow0, 1, 1$, and no more moves are left to be made. So we had $117+8=125$ valid moves, and $125$ is odd, so the player who went second, Bob, loses.