Michael's huge numbers

Call a number huge if the sum of its digits is greater than or equal to 23. 23. There are 35 35 huge three-digit numbers, and there are 2205 2205 huge four-digit numbers. If N N is the number of huge five-digit numbers, what are the last three digits of N N ?

This problem is posed by Michael T .

Details and assumptions

The number 12 = 012 12=012 is a 2-digit number, not a 3-digit number.


The answer is 760.

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.

2 solutions

Martin Falk
Nov 20, 2013

I apologise for the length of this solution, but I simply haven't found any elegant shortcut.

The stars and bars technique and the inclusion-exclusion principle are keys to my procedure. We first find a general solution, and then subtract all the solutions containing digits 10 _{ \geq 10} and all the solutions where the first digit is 0 0 .

We have x 1 + x 2 + x 3 + x 4 + x 5 23 x_{1} +x_{2} + x_{3} + x_{4} + x_{5} \geq 23 .

The maximum possible sum is 45 45 when all the digits are 9 9 .

Instead of finding all the solutions between 23 23 and 45 45 separately, it is useful to notice that the inequality

x 1 + x 2 + x 3 + x 4 + x 5 k x_{1} +x_{2} + x_{3} + x_{4} + x_{5} \leq k ,

where k k is any integer, may be transformed to an equation by introducing a dummy-variable x 6 x_{6} , which is not subjected to any restrictions:

x 1 + x 2 + x 3 + x 4 + x 5 + x 6 = k x_{1} +x_{2} + x_{3} + x_{4} + x_{5} + x_{6} = k .

(The pattern in a Pascal triangle will confirm this result).

To find the number of solutions to the original problem, the idea is then to find the number of solutions to x 1 + x 2 + x 3 + x 4 + x 5 45 x_{1} +x_{2} + x_{3} + x_{4} + x_{5} \leq 45 and subtract the number of solutions to x 1 + x 2 + x 3 + x 4 + x 5 22 x_{1} +x_{2} + x_{3} + x_{4} + x_{5} \leq 22 .

This is equivalent to finding the number of solutions to x 1 + x 2 + x 3 + x 4 + x 5 + x 6 = 45 x_{1} +x_{2} + x_{3} + x_{4} + x_{5} + x_{6}=45 and subtracting the number of solutions to x 1 + x 2 + x 3 + x 4 + x 5 + x 6 = 22 x_{1} +x_{2} + x_{3} + x_{4} + x_{5} + x_{6}=22 .

The solution has two main parts, A) and B).


A) Let us first find the number of solutions adding up to 45 45 .

Without restrictions on the values of the digits, the solution is

( 50 5 ) {50 \choose 5} .

From this number we must subtract all digits 10 _{ \geq 10} , and all solutions containing the first digit as 0 0 .


1) Subtracting the digits 10 _{ \geq 10} :

In order not to count any of our cases more than once, we use the inclusion-exclusion principle, i.e.:

general solution - ( \bigg ( number of single digits 10 _{ \geq 10} ) ) - number of double digits 10 _{ \geq 10} + + number of triple digits 10 _{ \geq 10} - ... + + ... ) \bigg ) .

Choosing first one digit x i 10 x_{i} \geq 10 , the equation is now transformed into

x 1 + x 2 + x 3 + x 4 + x 5 + x 6 = 35 x_{1} +x_{2} + x_{3} + x_{4} + x_{5} + x_{6} = 35

which has ( 40 5 ) { 40 \choose 5} solutions.

Since there are ( 5 1 ) { 5 \choose 1} ways of choosing one digit, we have ( 5 1 ) ( 40 5 ) { 5 \choose 1} { 40 \choose 5} ways of subtracting all the 10 10 's.

However, we have now subtracted too many, for there are cases were two digits are higher than ten at the same time, and they should be counted only once. With two digits higher than 10 10 , the equation is transformed to

x 1 + x 2 + x 3 + x 4 + x 5 + x 6 = 25 x_{1} +x_{2} + x_{3} + x_{4} + x_{5} + x_{6} = 25

which has the solution ( 30 5 ) {30 \choose 5} .

There are ( 5 2 ) {5 \choose 2} ways of choosing two digits at the time, and thus we have ( 5 2 ) ( 30 5 ) { 5 \choose 2} { 30 \choose 5} to subtract from the first case.

Having now removed too many cases, we must add the triple cases, and then subtract quadruple cases, etc.

Continuing like this until it is no longer possible to reduce the equation further by 10 10 , we find that the total number of digits 10 _{ \geq 10} to be subtracted from from the general solution is:

( 5 1 ) ( 40 5 ) ( 5 2 ) ( 30 5 ) + ( 5 3 ) ( 20 5 ) ( 5 4 ) ( 10 5 ) = 2018760 {5 \choose 1}{40 \choose 5} - {5 \choose 2}{30 \choose 5} + {5 \choose 3}{20 \choose 5} - {5 \choose 4}{10 \choose 5} = 2018760 .


2) We can now go on to subtract also the solutions with first digit 0 0 :

If we set x 1 = 0 x_{1}=0 , the equation transforms to

x 2 + x 3 + x 4 + x 5 + x 6 = 45 x_{2} + x_{3} + x_{4} + x_{5} + x_{6} = 45 .

Using the same procedure as for the previous case, but now with one less variable, we find the general solution and subtract the cases where digits >=10. This produces:

( 49 4 ) ( ( 4 1 ) ( 39 4 ) ( 4 2 ) ( 29 4 ) + ( 4 3 ) ( 19 4 ) ( 4 4 ) ( 9 4 ) ) = 10000 {49 \choose 4} - \bigg ( {4 \choose 1}{39 \choose 4} - {4 \choose 2}{29 \choose 4} + {4 \choose 3}{19 \choose 4} - {4 \choose 4}{9 \choose 4} \bigg ) = 10 000 .

The number of solutions to x 1 + x 2 + x 3 + x 4 + x 5 + x 6 = 45 x_{1} +x_{2} + x_{3} + x_{4} + x_{5} + x_{6} = 45 is then ( 50 5 ) 2018760 10000 = 90000 {50 \choose 5} - 2018760 - 10000 = 90000 .


B) Following the exact same procedure for the case x 1 + x 2 + x 3 + x 4 + x 5 + x 6 = 22 x_{1} +x_{2} + x_{3} + x_{4} + x_{5} + x_{6} = 22 , the number of solutions is now found to be:

( 27 5 ) ( ( 5 1 ) ( 17 5 ) ( 5 2 ) ( 7 5 ) ) ( ( 26 4 ) ( ( 4 1 ) ( 16 4 ) ( 4 2 ) ( 6 4 ) ) = 42240 {27 \choose 5} - \bigg ( {5 \choose 1}{17 \choose 5} - {5 \choose 2}{7 \choose 5} \bigg ) - \bigg ( {26 \choose 4} -\bigg ( {4 \choose 1}{16 \choose 4} - {4 \choose 2}{6 \choose 4} \bigg ) = 42 240 .


By subtracting the results B from A , we find the total number of solutions to x 1 + x 2 + x 3 + x 4 + x 5 23 x_{1} +x_{2} + x_{3} + x_{4} + x_{5} \geq 23 to be 90000 42240 = 47760 90000-42240 = 47760 .

The last three digits are 760 \boxed {760}

As Nathan said: There are 100 , 000 100,000 5 5 -tuples of digits, of which 50 , 000 50,000 have a sum over 23 23 (symmetry by taking 9 9 minus each digit). Of those, 35 35 begin with 00 00 . Furthermore, 2205 2205 begin with 0 x 0x , where x 0 x \neq 0 . Thus, 2205 + 35 = 2240 2205 + 35 = 2240 begin with 0 0 . Therefore, 50 , 000 2240 50,000 - 2240 begin with x x , where x 0 x \neq 0 , so those 50 , 000 2240 50,000 - 2240 correspond to valid, huge 5 5 -digit numbers. The last three digits of the above number is the same as that of 1 , 000 240 1,000 - 240 , or 760 \boxed{760} .

Alexander Bourzutschky - 7 years, 6 months ago

oh my god .,this problem makes my nose bleed,.,.,.,can you make it easier the next time around.,.

Ian Comparativo - 7 years, 6 months ago

Ooh.. ugly. This was actually a tournament problem on Aops. I ended up doing a bash like yours, although not nearly as ugly. It turns out there is quite a nice solution, however. There is a reason they give you the number of 3 and 4 digit huge numbers!

Nathan Weckwerth - 7 years, 6 months ago
Daniel Liu
Nov 17, 2013

Quick and Dirty solution:

The generating function for the 5 5 digit numbers is ( x + x 2 + + x 9 ) ( 1 + x + + x 9 ) 4 (x+x^2+\cdots+x^9)(1+x+\cdots+x^9)^4 . We multiply this out, preferably with a calculator like Wolfram Alpha, then sum the coefficients of x 23 x 45 x^{23}\rightarrow x^{45} and get 47760 47760 . The last three digits of this is 760 \boxed{760} .

The number of positive integers below 100,000 who's digits add up to the numbers 23-45 is equal to those that add up to 0-22. All of them add up to 0-45 so half of them will add up to 23-45. This means that 50,000=100,000/2 is the number of integers below 100,000 that add up to the numbers 23-45 this of course counts those that are 4 digit and 3 digit and 2 digit and 1 digit numbers. So we must subtract those out. 50,000-2205-35-0-0=47,760 . Therefore the answer is 760.

Nico Stirling - 7 years, 6 months ago

Hint: 23 is a specially chosen number.

Calvin Lin Staff - 7 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...