Skip to content

Counting numbers up to 100000 whose digits add to nine

Question

How many positive integers not exceeding 100,000100{,}000 have a digit sum of exactly 99? (For instance, 8181, 144144 and 1321213212 are such numbers.)

Short answer

715715. 100,000100{,}000 itself has digit sum 11, so pad every candidate to five digits with leading zeros. We then count solutions of d1+⋯+d5=9d_1+\cdots+d_5=9 in non-negative integers; no digit can exceed 99 anyway. Stars and bars gives (134)=715\binom{13}{4}=715.

Adapted from QuantQuestions.io; question and answer rewritten by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution

Lessons behind this question

Start with a free lesson: Probability Fundamentals is part of a free topic. Create a free account, no card needed, to read it in full with worked solutions.

Read it free