# Factorials and how many zeroes are at the end

Posted 17 days ago
295 Views
|
4 Replies
|
3 Total Likes
|
4 Replies
Sort By:
Posted 3 days ago
 I deployed a function at https://www.wolframcloud.com/obj/burbery1/DeployedResources/Function/TrailingZeroes/.
Posted 12 days ago
 Cool post Peter! Numbers with lots of trailing zeroes before the decimal point appear many unexpected places in discrete mathematics and combinatorics, such as the number of possible Rubik's Cube scrambles (43,252,003,274,489,856,000).As you have shown, it tends to happen for numbers which can be derived as the product of several combinatorics functions (e.g. permutations and combinations) like the number of possible Rubik's cube scrambles, or a number which is a factorial of a very large integer.
Posted 17 days ago
 For arbitrary bases I think this should do what you want. factorialZeros[n_Integer, b_Integer] /; n > 1 && b > 1 := Module[{pfacs, pexpons}, {pfacs, pexpons} = Transpose[FactorInteger[b]]; Min[Floor[ Map[Sum[Floor[n/#^j], {j, Floor[Log[#, n]]}] &, pfacs]/pexpons]] ] For example: In[86]:= factorialZeros[243, 12] (* Out[86]= 118 *) 
Posted 17 days ago
 Would Block work here because it takes less time or should Module be used?