How many numbers are between 1 and 99999 which have the sum of their digits equal to 15? I need the method.
1 Answer
Explanation:
Let us write
If
#d(n, k) = ""^(n+k-1) C_(k-1)" "# if#n <= 9#
With the constraint that at most
Then:
#d(15, 5) = ""^(15+5-1) C_(5-1) - 5(sum_(j=1)^6 d(j, 4))#
#color(white)(d(15, 5)) = ""^19C_4 - 5(""^4C_3 + ""^5C_3 + ""^6C_3 + ""^7C_3 + ""^8C_3 + ""^9C_3)#
#color(white)(d(15, 5)) = 3876 - 5(4 + 10 + 20 + 35 + 56 + 85)#
#color(white)(d(15, 5)) = 3876 - 5(210) = 3876 - 1050 = 2826#