5. In a row, 2011 consecutive five-digit numbers are written. It turned out that the sum of the digits of the 21st number is 37, and the sum of the digits of the 54th number is 7. Find the sum of the digits of the 2011th number. (Provide all possible answers and prove that there are no other answers).
Answer: 29. Solution. When transitioning from the 21st number to the 54th, the sum of the digits decreases by 30. It is easy to verify that this is possible only if there is a transition through a number divisible by 10000 along the way. This means that the thousands and hundreds places of the 21st number are nines, and the tens place is at least a six. Therefore, the tens digit of the 11th number listed is one less than that of the 21st, while the other digits are the same, and the sum of the digits of the 11th number is 36. The 2011th number is exactly 2000 more than the 11th, and there is a number divisible by 10000 between them. Therefore, the 11th and 2011th numbers coincide in the last three places, and the sum of the digits in the thousands and ten-thousands places of the 2011th number is 7 less (it fell by 8 when transitioning through a number divisible by 10000, and increased by 1 when transitioning through the next number divisible by 1000), from which we get the answer.