6. On an infinite tape, all natural numbers with the sum of digits equal to 2018 are written in ascending order. What number is written in the 225th position? (Method Commission)
Answer: 39... 998 (223 nines). Solution. Since $2018=9 \cdot 224+2$, the smallest number with a digit sum of 2018 will be 29... (224 nines), and the second smallest - the number 389...9 (223 nines). In the next 223 largest numbers with a digit sum of 2018, the eight "travels" from the beginning to the end of the row of nines, moving one position each time. After 223 steps, it will end up at the end of the number, which gives us the answer.