1. For a natural number , let denote the number obtained by consecutively writing all natural numbers from 1 to one after another (e.g., 1234567891011121314). Let the function be defined as follows: is the smallest number of digits that need to be removed from the representation of the number so that the newly obtained number is divisible by 8 (it is allowed to remove all digits of , in which case the newly obtained number is considered to be zero). Do there exist natural numbers and such that for all , it holds that
Problem 1018
Official solution
1. Suppose such numbers and exist. Then the set of all possible values that the function can take is clearly equal to . Since this set is finite, it has a maximum element; let this be . Now let be an arbitrary natural number whose decimal representation ends with ones. Then the number also ends with ones, so for it to be even (and especially divisible by 8), we must remove all those ones from the end of its decimal representation. Therefore, , i.e., the function takes a value greater than , a contradiction.