The number of integers, between 100 and 1000 having the sum of their digits equals to 14, is
Answer: 70
Solution
Let the number be with , , .
Substitute : , with , , .
Number of nonnegative integer solutions with no upper bound: .
Subtract solutions violating each bound (inclusion–exclusion):
: set , then , giving solutions.
: set , then , giving solutions.
: similarly solutions.
No two bounds can be violated simultaneously (e.g. and would need , impossible), so no addback terms are needed.
Substitute : , with , , .
Number of nonnegative integer solutions with no upper bound: .
Subtract solutions violating each bound (inclusion–exclusion):
: set , then , giving solutions.
: set , then , giving solutions.
: similarly solutions.
No two bounds can be violated simultaneously (e.g. and would need , impossible), so no addback terms are needed.
JEE Main · 2024 · 09 Apr 2024 · Shift 2 · Integer answer