20030814, 09:25  #1 
Jul 2003
41 Posts 
factorial puzzle (requires maths)
For math's puzzle affectionados only, since I guess that your favourite large number program could give you the answer quite quickly. See if can do it without resorting to such newfangled techniques.
How many trailing zeros are there in 534! (that's factorial (534) ) Graeme 
20030814, 13:26  #2 
6809 > 6502
"""""""""""""""""""
Aug 2003
101×103 Posts
10010100001001_{2} Posts 
At least 106.
Rough calculation. 534/10=53 10's plus 53 5x2 pairs. 8) 
20030814, 14:26  #3 
Cranksta Rap Ayatollah
Jul 2003
1010000001_{2} Posts 
131

20030814, 14:31  #4 
Aug 2003
5 Posts 
Method
Find all factors that will multiply by 10, 09
e.g. 2/5 = 10 4/5 = 20 6/5 = 30 8/5 = 40 So out of every 10 numbers, there are 5 that will give a trailing 0. 534 / 10 is about 53 complete series of 10 numbers. Since each series will hit every other series, and 2 out of 10 give 0's (0 and 5), each set of 10 numbers should give about 10 (Any * 0 is 0) + 4 (non0 even * 5 = 0) 0's per series. so a rough guess would be 14^53 0's. 
20030814, 15:01  #5  
6809 > 6502
"""""""""""""""""""
Aug 2003
101×103 Posts
19×499 Posts 
Quote:


20030814, 15:06  #6 
Aug 2002
Cincinnati
5 Posts 
to solve this you need to count total pairs of 5's and 2's. since there are quite a few mroe 2's than 5's you need to count the total number of 5's in the factorization of this number.
534/5=106 534/(5^2)=21 534/(5^3)=4 534/(5^4)=0 adding... we get 106+21+4=131 so there are 131 trailing zeroes. 
20030818, 09:00  #7 
Jul 2003
41 Posts 
131 is the right answer
Graeme 
20030819, 20:40  #8 
Aug 2002
Portland, OR USA
2×137 Posts 
I wrote a program in college that asked for a number n < 2^32, and spat out the prime factorization of n! almost as fast as they'd entered the number. (This was in 1986.)
First they said it was faked, I couldn't possibly calculate or store n!, until they checked random entries. Then they said I had a table of every kth one up to the max they could verify and an exact interpolation method. Then for a while they were really impressed, ;) until I showed them the code. The trick was I never had to deal with n!, just n. I used zacksg1's idea recursively for all primes p < n.[list]534/5 = 106, total = 106 106/5 = 21, total += 21 21/5 = 4, total += 4 ... = 131[/list:u]This requires only log_p(n) integer divisions (+ the sum) for each prime. The second trick was I sieved my primes and printed out the primes & exponents as I went along. So there was literally no delay before it started printing. It's actually easier to factor n! than a number of similar size, because you're not factoring  you know all the factors, you're just adding up the exponents. 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Factorial puzzle  henryzz  Puzzles  5  20150402 12:58 
Factorial  mfgoode  Puzzles  6  20070724 14:24 
MATHS MUSINGS IMaths & Teaching KungFu  devarajkandadai  Miscellaneous Math  0  20040916 04:27 
Perfect shuffling puzzle (requires programming)  NickGlover  Puzzles  18  20030726 01:10 
Factorial problem  xilman  Puzzles  12  20030720 20:22 