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).


1 Answer 1


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:


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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.