A magician with an assistant is going to perform the following trick. A spectator writes a sequence of $N$ digits on a board. The magician's assistant covers two adjacent digits with a black circle. Then the magician enters. His task is to guess both covered digits (and the order in which they are located). For what smallest $N$ can the magician agree with the assistant so that the trick is guaranteed to succeed?
Suppose that for some value of $N$ the trick is possible. Then for each variant of the sequence with two closed digits (let their number be $k_{1}$), the magician can restore the original; hence, to each sequence with two closed digits, the magician can uniquely correspond the restored sequence of $N$ digits (let their number be $k_{2}$). Therefore, $k_{1} \geq k_{2}$.

Note that $k_{1}=(N-1) 10^{N-2}$ (there are $N-1$ ways to erase two digits, and for the remaining $N-2$ positions, there are 10 options for each). And $k_{2}=10^{N}$. Thus, $N-1 \geq 100$, which means $N \geq 101$.

We will show how to perform the trick for $N=101$. Let the sum of all digits in odd positions have a remainder $s$ when divided by 10, and the sum of all digits in even positions have a remainder $t$ when divided by 10 (positions are numbered from left to right by numbers from 0 to 100). Let $p=10 s+t$. The assistant will cover the digits in positions $p$ and $p+1$. Seeing which digits are covered, the magician will determine $p$, and consequently, determine $s$ and $t$. Note that one covered digit is in an odd position, and the other is in an even position. Thus, by calculating the sum of the open digits in odd positions and knowing $s$, the magician will determine the covered digit in the odd position.

Similarly, the covered digit in the even position is determined.

## Answer

For $N=101$.

Submit a comment