Let denote the sum of the digits of the positive integer . For example, and . For how many two-digit values of is ?
- A)
- B)
- C)
- D)
- E)
Answer
E
Key insight
The digit sum of a two-digit number is at most 18, so it must be 3 or 12; count numbers with those digit sums: 3 + 7.
Solution
For a two-digit , the digit sum lies between and . We need with . Single-digit works only for ; two-digit from to has digit sum , which equals only for .
Now count two-digit with each digit sum.
- Digit sum : tens digit with units : . That is numbers.
- Digit sum : tens digit from to with units from down to : . That is numbers.
Total: .
The answer is .
Why this works
Iterated digit sums shrink fast, so working from the outside in leaves only a couple of possible intermediate values. Bounding the inner quantity first () converts a vague two-layer condition into two concrete one-layer counts, each of which is a short list indexed by the tens digit.
The trap
Forgetting the digit sum 12 case (answering 3), or including 03 as a two-digit number with digit sum 3.
Common mistakes
- Forgetting the digit sum case (answering ), or including as a two-digit number with digit sum .
- Listing the digit-sum- numbers with tens digit starting at (giving , which sums to ) or missing .
Techniques
Organized listing / direct enumeration · Split into exhaustive cases and handle each