The number of natural numbers, between 212 and 999, such that the sum of their digits is 15, is .
Answer
64
Solution
Let the number be abc, 1 a 9, 0 b, c 9, b + c = 15 - a.
Number of pairs (b, c) with b + c = s: s + 1 if s 9, 19 - s if s 9.
a = 1 (s = 14): 5; a = 2 (s = 13): 6; a = 3 (s = 12): 7
a = 4 (s = 11): 8; a = 5 (s = 10): 9; a = 6 (s = 9): 10
a = 7 (s = 8): 9; a = 8 (s = 7): 8; a = 9 (s = 6): 7
Total from 100 to 999 = 69
Numbers ≤ 212 with digit sum 15: all 5 with a = 1 (159, 168, 177, 186, 195); for a = 2 the smallest is 249 > 212.
required number = 69 - 5 = 64
Answer: 64