Look for “factorial calculator” on Google and you’ll take a long time to find a factorial calculator that thinks that 100! doesn’t have an ‘e’ in it. If you’re going to write a dinky little app like that, be aware that there are limitations to it and tell people. I’m not going to link to any of them, they’re all naughty applications that shouldn’t be allowed out in the real world. But Dima Stopel’s large number factorial calculator isn’t afraid to give you all the digits.
Pity the answer is wrong. 100! should have at least 20 trailing zeros. 10 from 10, 20,…, 100. And another 10 from 2*5,12*15,22*25,…,92*95. In fact it should have exact 20 trailing zeros.
Dima’s program gives:
100! == 93326215443944152681699238856266700490715968264381621468592963895217599993229915
608941463976156518286253697920827223758251185210916864000000000000000000000000
Well, ten from the multiples of 10, and an extra one from 100. And ten from even multiples of five. And it chucks in a couple more, which I can’t fault, but can’t explain, because I’ve not thought about this at any great length – but it seems right to me.
Your right Josh, that looks better. It was giving me an answer with 12 zero’s but I can’t reproduce it now. I was pressing return rather than the button but even that works now. I defintiely tried it a few times.
And yes I now think it shoul be exactly 24 trailing zeros (which it is). One for each multiple of 5 and an extra one for the 4 multiples of 25. There are plenty of multiples of 2 to convert each five to a 10 and enough mutiples of 4 to convert the 25’s to multpiles of 100. Once all the multiples of 5 are taken out of 1*2*…*100 the remaing product will not be divisible by 10.
Josh,
Thank you for your post 🙂
Check out the Fibonacci numbers calculator:
http://www.cs.bgu.ac.il/~stopel/suexec/fib.cgi
the “exact and fast” method, it is far more sophisticated.
Cheers