All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Curious Consecutive Cyphers (Posted on 2008-11-25)
Each of the last T digits in the decimal representation of the product of 1!*2!*3!.....99!*100! is zero, but the (T+1)th digit from the right is nonzero.

Determine the remainder when T is divided by 1000.

Note: Try to derive a non computer-assisted method, although computer program/spreadsheet solutions are welcome.

 See The Solution Submitted by K Sengupta Rating: 2.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: Solution | Comment 4 of 5 |
(In reply to Solution by Dej Mar)

Both UBASIC and MIRACL Calc agree that the (T+1)th digit from the right is an 8.  So I checked your figures.  I got, as a list of powers of primes in the number:

` 2 4731 3 2328 5 1124 7  73411  41413  34317  25019  22023  17429  12931  11737   9141   7943   7347   6153   4859   4261   4067   3471   3073   2879   2283   1889   1297    4`

These disagree in a couple of places from yours. They were obtained by the program:

DATA 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97

DIM prime(25)

FOR i = 1 TO 25: READ prime(i): PRINT prime(i); : NEXT: PRINT

FOR p = 1 TO 25

f = prime(p)
t = 0
FOR i = 1 TO 100
f2 = f
DO
t = t + INT(i / f2)
f2 = f2 * f
LOOP UNTIL f2 > i
NEXT
PRINT USING "## ####"; f; t
d = f MOD 10: tot(d) = tot(d) + t
NEXT

The next few lines of the program were added also:

PRINT tot(2) - 1124;
FOR i = 3 TO 9 STEP 2
IF i <> 5 THEN
PRINT tot(i);
END IF
NEXT
PRINT

which tracks how many times the rightmost digit is 2 (in excess of the 1124), 3, 7 or 9 respectively:

3607  3012  1174  425

I see, for example, that your count of primes ending in 7 agree with mine:

`7  73417 25037  9147  6167  3497   4`

These add to my 1174, rather than your 1248.

3607 mod 4 is 3 giving an 8.
3012 mod 4 is 0 giving a 1.
1174 mod 4 is 2 giving a 9.
425 mod 2 is 1 giving a 9.

8 x 1 x 9 x 8 = 648 so the last digit before the terminal zeros is 8.

 Posted by Charlie on 2008-11-25 17:30:13

 Search: Search body:
Forums (0)