10.4. The number $\underbrace{111 \ldots 11}_{99 \text { ones }}$ is written on the board. Petya and Vasya play the following game, taking turns; Petya starts. On a turn, a player either writes a zero in place of one of the ones, except the first and last, or erases one of the zeros. The player loses if, after their move, the number on the board is divisible by 11 for the first time. Who wins with correct play?

## 10th grade

## Second day
10.4. Answer. Petya.

Note that the number $A_{n}=1 \underbrace{101 \ldots 11}_{n \text { ones }}$ is not divisible by 11. Indeed, if $n$ is even, then $A_{n}=\underbrace{000 \ldots 00}_{n+1 \text { zeros }}+\underbrace{11 \ldots 11}_{n \text { ones }}$, and if $n$ is odd, then $A_{n}=\underbrace{900 \ldots 00}_{n \text { zeros }}+\underbrace{111 \ldots 11}_{n+1 \text { one }}$.

In both cases, the second addend is divisible by 11, while the first is not.

Since the number on the board decreases with each move, sooner or later one of the players will lose. We will present a non-losing strategy for Petya, acting according to which, he will be able to get a number of the form $A_{n}$ after each of his moves. On his first move, Petya will replace the second leftmost one with a zero, and subsequently either erase the zero that appeared on Vasya's previous move (i.e., a number of the form $A_{m}$), or, if Vasya erased the only zero, again replace the second leftmost one with a zero. If Petya cannot perform the latter action, then the number before him is 11, i.e., Vasya has already lost on the previous move.