How many integers between 1 and 1,000,000 inclusive have a sum of digits of 13?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I did similarly. Except that after giving 10 items to one. I spread the remaining 3 over all 5 of them. This way there would be need to calculate seperately for the 11 and 12 cases
wow great solution ...reduces effortsof multinomial
Yep i did the same and my lucky no is 13 😃
That can be solved with generating functions with a simple reformulation of the problem. Think of it as: How many different solutions does x 1 + x 2 + . . . + x 6 = 1 3 have for 0 ≤ x i ≤ 9 And for that, all we need to do is to exponentiate the polynomial 1 + x + x 2 + x 3 + x 4 + . . . + x 9 to the sixth power then check the coefficient of x 1 3 , which, according to wolfram alpha , is 8232. Generating functions is a relatively new topic but extremely relevant in discrete mathematics. Please refer to Donald Knuth's Concrete Mathematics for a better understanding.
I used multinomial theorem to solve it.
Problem Loading...
Note Loading...
Set Loading...
The solutions are precisely all 6-digit numbers (possibly starting in one or more zeroes) with sum of digits equal to 13. Think of the digits as six (ordered) bins in which we must place 13 items. The standard "stars-and-bars" method tells us that this can be done in ( 1 3 + 5 5 ) = 8 5 6 8 ways. This is not the answer yet, because we have included situations in which a bin has 10 or more items, while digits cannot have values exceeding 9. Therefore we must subtract these out.
The number of ways in which one bin gets 10 items, and the remaining 3 are spread over the remaining five bins is 6 ⋅ ( 3 + 4 4 ) = 2 1 0 ; the factor 6 represents the six possible choices for that one special bin.
In the same way, for 11, 12, and 13 items we find 90, 30, and 6 possibilities, respectively.
Subtracting these out, we find the final solution 8 5 6 8 − 2 1 0 − 9 0 − 3 0 − 6 = 8 2 3 2 .