# A number like waldo?

What is the smallest whole number that when its individual digits are summed, produces a number 4 digits long? For example, the number $$5357$$ is no where close since $$5 + 3 + 5 + 7 = 20$$.

Note: I'm looking for an answer that includes a logical path to the answer (e.g. working backwards from a 4 digit number).

The smallest number is going to be the one with the least digits. We need to make use of all the digits as efficiently as possible. Therefore, we should:

use almost entirely 9s. If, for example, we were trying to find the smallest number which sums to 18, 99 is better than 1188. Of course, using entirely 9s will get us past 1000 (the smallest 4-digit number). It takes 111 nines and 1 one to sum to 1000. We can arrange the digits however we want, but a 1 in the leftmost place will make the smallest number.

Therefore, the solution is

1, followed by 111 9s:

1999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

I’ll admit I used a computer (despite the tag) to generate the output, since a Bash command is much faster and more accurate than typing that up by hand.

• You could also change the 1 to a 2 and change an eight to a nine... it still works. Oct 12, 2021 at 21:53
• But then it would be a larger number. Oct 12, 2021 at 22:02
• And I forgot about that constraint. palmface Oct 12, 2021 at 23:13