Two players take turns writing arbitrary digits in a row from left to right on a board. The player loses if, after their move, one or several consecutive digits form a number that is divisible by 11. Which player will win with correct play?

#
Let's denote the digits written by the players sequentially as $a_{1}, a_{2}, \ldots$, with the first player writing the digits with odd indices and the second player writing the digits with even indices. Consider the remainders $r_{i}$ from dividing the alternating sums $S_{0} = 0, S_{1} = a_{1}, S_{2} = a_{1} - a_{2}, \ldots, S_{k} = a_{1} - a_{2} + a_{3} - \ldots + (-1)^{k-1} a_{k}$ by 11.

According to the divisibility rule for 11, after the $k$-th move, a number divisible by 11 will appear on the board if and only if $r_{k}$ coincides with one of $r_{0}, \ldots, r_{k-1}$. Arrange these remainders in a circle in a clockwise direction from 0 to 10, and represent the sequence of moves as a process of moving around the circle to non-repeating remainders $r_{i}$. In this process, the first player, on the $i$-th move, "adds" to $r_{i-1}$ any number $a_{i}$ from 1 to 9, while the second player adds any number from -1 to 9. Thus, besides repeating an already encountered remainder, the first player is prohibited from moving counterclockwise by 1, and the second player is prohibited from moving clockwise by 1. After the $i$-th move, 10 - $i$ remainders will remain free. A player can guarantee a move if there are at least two free remainders, so the players can make the first eight moves, but the 11th move can never be made.

Consider the situation after the seventh move (which is the first player's move), when 3 remainders are free. Let's examine three cases.

1) The free remainders are consecutive: $i-1, i, i+1$. Then the second player writes a number with remainder $i$ (occupies remainder $i$), the first player writes $-i+1$, and the second player writes $i-1$ and wins.

2) The remainders are arranged as follows: two adjacent remainders $-i, i+1$ and one separate remainder $j$. Then the second player occupies one of the remainders $i$, $i+1$, and if the first player occupies remainder $i+1$, the second player occupies $j$ and wins, or if the first player occupies $j$, the second player occupies one of the remaining $i, i+1$ and wins.
3) No two remainders are adjacent: $i, j, k$. Then the second player can occupy one of them, and after the first player's move, the second player can occupy the last free remainder and win.

## Answer

The second player.

Submit a comment