# Practice Paper 1 Question 12

Let $$n < 10$$ be a non-negative integer. How many integers from $$0$$ to $$999$$ inclusive have the sum of their digits equal to $$n$$? Give your answer in terms of $$n$$. Hint: Try first for integers from $$0$$ to $$99$$.

The above links are provided as is. They are not affiliated with the Climb Foundation unless otherwise specified.

## Warm-up Questions

1. How many $$3$$ digit numbers, whose digits consist solely of even numbers, exist?

2. A ternary number consists of only $$2$$s, $$1$$s and $$0$$s. How many values can be represented by a $$7$$ digit ternary number?

## Hints

• Hint 1
You can use inspection (there are only 10 cases) for the case of max 2 digits to get an expression in terms of $$n$$.
• Hint 2
For the case of max 3 digits, what if you fix one digit to some value $$p\le n$$?
• Hint 3
What must be the sum of the remaining max 2 digits in terms of $$p$$ and $$n$$?
• Hint 4
How many max 2 digits numbers have their digit sum equal to $$n-p$$?
• Hint 5
How should we incorporate that for all values of $$p$$?

## Solution

For max $$99$$ (max 2 digits) case one can observe, by inspection, that there are $$n+1$$ numbers whose digit sum is $$n$$.

When there are max 3 digits, let's fix one of the digits to $$p\le n$$. The sum of the remaining max 2 digits must thus equal $$n-p,$$ and we know there are $$n-p+1$$ numbers with that property. Taking all possible values of $$p$$ we get \begin{align}\sum_{p=0}^n (n-p+1)&=(n+1)\sum_{p=0}^n 1-\sum_{p=0}^n p\\&=\frac{(n+1)(n+2)}{2}.\end{align}

If you have queries or suggestions about the content on this page or the CSAT Practice Platform then you can write to us at oi.tasc@sulp.ecitcarp. Please do not write to this address regarding general admissions or course queries.