A sequence of integers is written on an infinite tape. The first number is ; each number except the first one is obtained by adding to the previous number its minimal nonzero digit (in decimal representation). Find the number of digits in the decimal representation of the number at th place in this sequence.
(I. Bogdanov)
Solution
Answer: .
Since each number in the sequence, starting from the second, is greater than the previous one by at least , the -th number is at least , so it has at least digits. Denote the -th number of the sequence by , and let be the smallest index such that has digits. If we show that , then the -th number has at most digits, i.e., exactly digits.
Consider numbers from to that do not have any s in their decimal representation. Padding each on the left with zeros to digits, we get all sequences of length consisting of digits other than . There are such sequences. Thus, among the numbers , there are at most numbers without a in their decimal representation (since all are at most ).
Now consider the process of obtaining from . At each of the steps, we add a number from to , and the number of steps where we add something other than does not exceed . Therefore,
from which
It remains to show that . For this, it suffices to prove that . Note that , so and . Therefore,