Skip to content

Counting numbers up to 100000 with digit sum nine

Question

How many positive integers not exceeding 100,000100{,}000 have decimal digits adding up to 99? (Examples: 8181, 144144, 1321213212.)

Short answer

715715. 100,000100{,}000 itself has digit sum 1, so pad every smaller number with leading zeros to five digits. We need non-negative solutions of d1+⋯+d5=9d_1+\dots+d_5=9; no digit can exceed 9, so 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