On a paper tape, bus tickets with numbers from 000000 to 999 999 are printed. Then, those tickets where the sum of the digits in the even positions equals the sum of the digits in the odd positions are marked in blue. What will be the greatest difference between the numbers of two adjacent blue tickets?

#
Let's first show that the blue tickets with numbers 908919 and 909909 are adjacent. Suppose we have found a blue ticket with the number $908919990$. First, note that the numbers $X$ and $Y$ are divisible by 11, which means their difference is also divisible by 11. Therefore, $Y-X \geq 1001$. On the other hand, all tickets with numbers of the form $\overline{a b c a b c}$ are blue, and the difference between adjacent numbers of this form is 1001. Therefore, $Y-X=1001, X=\overline{a b c a b c}$. Consider the case $a \leq 8$. If $c \geq 1$, then between the tickets $X$ and $Y$ there is a blue ticket $\overline{a b c(a+1) b(c-1)}$. If $b \geq 1$, then the ticket $X<$ $\overline{a b c(a+1)(b-1) c}<Y$ is blue. The only remaining case is $b=c=0$. But in this case, the ticket $X<\overline{a 00 a 11}<Y$ is blue. Thus, for $a \leq 8$, the tickets $X=\overline{a b c a b c}$ and $X+1001$ cannot be adjacent blue tickets. Now consider the case $a=9$. If $b \leq 8$, then between $X$ and $Y$ there is a blue ticket with the number $\overline{9 b c 8(b+1) c}$. If $b=9$, then between $X=\overline{99 c 99 c}$ and $Y=\overline{99(c+1) 99(c+1)}$ there is a blue ticket with the number $\overline{99(c+1) 98 c}$.

## Answer

990.00

Submit a comment