Lucky 13

How many integers between 1 and 1,000,000 inclusive have a sum of digits of 13?


The answer is 8232.

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.

3 solutions

Arjen Vreugdenhil
Aug 13, 2016

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 ( 13 + 5 5 ) = 8568 \left(\begin{array}{c} 13+5 \\ 5 \end{array}\right) = 8568 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 ) = 210 ; 6\cdot \left(\begin{array}{c} 3+4 \\ 4 \end{array}\right) = 210; 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 8568 210 90 30 6 = 8232 . 8568 - 210 - 90 - 30 - 6 = \boxed{8232}.

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

Shreyash Rai - 4 years, 7 months ago

Log in to reply

Sorry I meant all 6 of them

Shreyash Rai - 4 years, 7 months ago

wow great solution ...reduces effortsof multinomial

space sizzlers - 4 years, 9 months ago

Yep i did the same and my lucky no is 13 😃

aryan goyat - 4 years, 6 months ago
André Winston
Dec 10, 2016

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 = 13 x_1 + x_2 + ... + x_6 = 13 have for 0 x i 9 0 \leq x_i \leq 9 And for that, all we need to do is to exponentiate the polynomial 1 + x + x 2 + x 3 + x 4 + . . . + x 9 1 + x + x^2 + x^3 + x^4 + ... + x^9 to the sixth power then check the coefficient of x 13 x^{13} , 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.

Anubhav Tyagi
Aug 17, 2016

I used multinomial theorem to solve it.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...