How many natural numbers below 1 million have their sum of digits equal to 18?

How many natural numbers below 1 million have their sum of digits equal to 18?

One way to solve this would be to make all possible cases in which the digits of the no. add up to 18 and then permute them as well as repeat this process for 1-digit, 2-digit... up till 6-digit.....but obviously thats a very cumbersome way to solve this problem. Anyone can help me out with a shorter solution?

• These are just the ordered $6-$tuples of non-negative integers which sum to $18$. Stars and Bars gives us a way to count these. – lulu Nov 3 '16 at 18:20
• @lulu nope, $11 + 2 +5$ doesn't correspond to any such number, because $11$ is not a digit. – Gabriel Burns Nov 3 '16 at 18:22
You can use a stars and bars approach to count the total number of (ordered) ways to add six numbers (possibly including zero) totaling $18$, then subtract $6$ times the number of ways to add six numbers totaling $8$ (thus removing the cases where one of the numbers is $\ge 10$).