.
So, we need to find the number of integers between 1 to 999,999 which have sum of the digits is 12
The numbers have maximum 6 digits.
So, we are trying to find the number of solutions of the equation given below
d!+d2+d3+d4+d5+d6=12, where 0≤di≤9 ........... (i)
Let's forget about the restriction first and try to find out the number of solutions of (i) with di≥0
If we think there are 12 balls and 6 boxes, and we need to put all these balls(with repetition) in these 6 boxes,
The total no. of possible ways to do so is 6+12−1C12=17C12
Now, considering count of balls in each boxes, we can get the number.
But, the upper bound of 9 for each digit is not mentioned.
Though this violation of upper bound can only exist in one place, because 10+3>12
Let's say it has occured at first position.
So, we need to decide number of solutions to the equation
d′1+d2+d3+d4+d5+d6=2 with di≥0
which is 6+2−1C2=7C2
If any one of the six positions get violated, total no. of violation =6×7C2
So, the number of solutions to equation (i) is 17C12−6×7C2
=6188−126=6062
Hence, the answer is 6062.