Problem

Source: (2022-) 2023 XVI 16th Dürer Math Competition Finals Day 2 E10

Tags: number theory



One day Mnemosyne decided to colour all natural numbers in increasing order. She coloured $0$, $1$ and $2$ in brown, and her favourite number, $3$, in gold. From then on, for any number whose sum of digits (in the decimal system) was a golden number less than the number itself, she coloured it gold, but coloured the rest of the numbers brown. How many four-digit numbers were coloured gold by Mnemosyne? The set of natural numbers includes $0$.