How many 7 digit codes are possible where each digit is 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9 and the product of all the digits is 10000?
The prime factorization of 10,000 = 5 x 5 x 5 x 2 x 2 x 2 x 1 (using 7 digits).
So the 7 digit possibilities are 5 x 5 x 5 x 2 x 2 x 2 x 1
a) 5 x 5 x 5 x 2 x 2 x 2 x 1
b) 5 x 5 x 5 x 4 x 2 x 1 x 1
c) 5 x 5 x 5 x 8 x 1 x 1 x 1
There are 7! / (3! x 3!) = 140 ways to do part a.
There are 7! / (3! x 2!) = 420 ways to do part b.
There are 7! / (3! x 3!) = 140 ways to do part c.
Adding, there are 700 ways.
Wouldn't 5 x 5 x 5 x 2 x 2 x 2 x 1 be the prime factorization for 1,000?
The combinations of digits that I found were 5 x 5 x 5 x 5 x 2 x 2 x 4, 5 x 5 x 5 x 5 x 4 x 4 x 1, and 5 x 5 x 5 x 5 x 8 x 2 x 1
How many ways are there to form a 7-digit code where each digit can be from 0 to 9 and the product of all the digits in the code is 10,000?
Thanks Geno and Mathmathj28,
Since there is disagreement I will add my 10cents worth.
factor(10000) = 2^4*5^4
So I can only use 2,4,8,5,1 and 5 must be used 4 times
10000/5^4 = 16
5 5 5 5
I need 3 digits that multiply to 16 8,2,1 4,4,1 4,2,2, and that is it.
So the digits can be
5 5 5 5 8 2 1 7!/4! =210
5 5 5 5 4 4 1 7!/(4!2!) = 105
5 5 5 5 4 2 2 7!/(4!2!) = 105
210+105+105 = 420 ways
My not-so-short computer code agrees with Melody's number:
a=0;b=0;c=0;d=0;e=0;f=0;g=0;p=0; cycle:n=a*1000000+b*100000+c*10000+d*1000+e*100+f*10+g; if(a*b*c*d*e*f*g==10000, goto loop, goto next);loop:printn,", ",;p=p+1; next:g++;if(g<10, goto cycle, 0);g=1;f++;if(f<10, goto cycle, 0);g=1;f=1;e++;if(e<10, goto cycle,0);g=1;f=1;e=1;d++;if(d<10, goto cycle,0);g=1;f=1;e=1;d=1;c++;if(c<10, goto cycle,0);g=1;f=1;e=1;d=1;c=1;b++;if(b<10, goto cycle,0);g=1;f=1;e=1;d=1;c=1;b=1;a++;if(a<10, goto cycle,0);print"Total = ",p
OUTPUT:
1255558 , 1255585 , 1255855 , 1258555 , 1285555 , 1445555 , 1454555 , 1455455 , 1455545 , 1455554 , 1525558,............................. 8525551 , 8551255 , 8551525 , 8551552 , 8552155 , 8552515 , 8552551 , 8555125 , 8555152 , 8555215 , 8555251 , 8555512 , 8555521 , Total = 420