number of zeroes in 100 factorial. - MathOverflow most recent 30 from http://mathoverflow.net2013-05-18T23:41:16Zhttp://mathoverflow.net/feeds/question/102092http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://mathoverflow.net/questions/102092/number-of-zeroes-in-100-factorialnumber of zeroes in 100 factorial.Omnitic2012-07-13T02:38:40Z2012-07-21T02:42:58Z
<p>I was on math.stackexchange the other day and i found a question that said How many zeroes are there in 100!. I quickly factored it out and said that there where 24 zeroes. However thats only the trailing zeroes (as the person who asked the question quickly pointed out). As the days passed no one answered the question. My question is the following: is there a method to figure it out without having to compute the whole answer? I initially thought that it could be solved using many divisibility properties but I didn't figure anything out.</p>
http://mathoverflow.net/questions/102092/number-of-zeroes-in-100-factorial/102095#102095Answer by Tom Dickens for number of zeroes in 100 factorial.Tom Dickens2012-07-13T02:54:12Z2012-07-13T02:54:12Z<p>Given a prime $p$, it occurs $m$ times in the prime factorization of $n!$, where </p>
<p>m = $ \lfloor \frac{n}{p} \rfloor + \lfloor \frac{n}{p^2} \rfloor + \lfloor \frac{n}{p^3} \rfloor + \cdots $</p>
<p>This is explained in many number theory books. Apply this for $p=2$ and $p=5$, and use the value you get for 5, since this occurs many fewer times. </p>
<p>Tom</p>
http://mathoverflow.net/questions/102092/number-of-zeroes-in-100-factorial/102096#102096Answer by Gerhard Paseman for number of zeroes in 100 factorial.Gerhard Paseman2012-07-13T03:00:07Z2012-07-13T03:00:07Z<p>It is unlikely. There are ways to compute the nth digit of certain numbers in certain bases (for example, pi in base 16) without having to compute the entire number, but in most situations, the number or formula for it either has very special properties (e.g. 101*10^n) in order to answer the question, or the work done to answer the question is tantamount to calculating the number, writing it down, and counting the digits. Not only do I know of no
way to answer the question otherwise, I will wager a small amount of money that no such nice way will posted here for the next 2 years.</p>
<p>Gerhard "Willing To Formalize The Bet" Paseman, 2012.07.12</p>
http://mathoverflow.net/questions/102092/number-of-zeroes-in-100-factorial/102102#102102Answer by Will Jagy for number of zeroes in 100 factorial.Will Jagy2012-07-13T03:43:26Z2012-07-13T04:02:18Z<p>EDIT: this doesn't really work. I'm still a good human being.</p>
<p>Evenly enough, it seems possible to get the number of zeros in the binary expansion of $n!$</p>
<p>One can get a fairly accurate expression for $$\log_2 \; n! = \frac{\log \; n!}{\log 2}$$ from using extra terms in <a href="http://en.wikipedia.org/wiki/Stirling%2527s_approximation#Speed_of_convergence_and_error_estimates" rel="nofollow">Stirling's formula</a>. Taking the floor of that and adding 1 gives the total number of digits in base two..</p>
<p>Legendre's formula $$ v_2(n!) = \left\lfloor \frac{n}{2} \right\rfloor + \left\lfloor \frac{n}{4} \right\rfloor + \cdots $$ has a companion,</p>
<p>$$ v_p(n!) = \frac{n - S_p(n)}{p-1} $$ where $S_p(n)$ is the sum of the digits when $n$ is written in base $p.$ As all the digits in a base two expansion are $1,$ we find that $S_2(n)$ is simply the count of 1's in the base two expansion of $n.$ </p>
<p>Alright, some people, who shall remain nameless, have attempted to cast aspersions on the reputation of your humble servant, pointing out that the number of ones in the binary expansion of $n!$ is not the same as the number of ones in the binary expansion of $n$ itself. I try so hard. Don't change the light bulb, I'll just sit here in the dark. </p>
http://mathoverflow.net/questions/102092/number-of-zeroes-in-100-factorial/102761#102761Answer by Halfdan Faber for number of zeroes in 100 factorial.Halfdan Faber2012-07-20T18:30:50Z2012-07-21T02:42:58Z<p>Using well known approximations for the length and number of trailing zeroes of n!, and making the reasonable assumption that the inside zeros appear with frequency $\frac{1}{10}$, we get the following approximation of the total number of zeros, t, in n!:</p>
<p>$t = \lfloor \frac{1}{10}(\frac{\log (2 \Pi n)}{2}+n\log (\frac{n}{e})- \frac{n}{4}+ \log(n)) + \frac{n}{4} - log(n)\rfloor $</p>
<p>Which simplifies to:</p>
<p>$t = \lfloor \frac{n (9 \ln (10)-4)+4 (n-9) \ln (n)+2 \ln(2 \Pi n)}{40 \ln(10)} \rfloor$</p>
<p>This approximation seems to work well for n up to at least 10,000.</p>
<p>100!, with digit length 158, has less inside zeroes, 6, with 24 trailing, than the normal expectation for a total of 30, with t=36.</p>
<p>98! is "zero-perfect", i.e. inside zeroes appear with exactly frequency $1/10$, with actual total zero count 35 and $t = 35$</p>
<p>Other examples of zero-perfect factorials are: 1009!, 1097!, 1112!, 2993!, 6128!, ....</p>
<p>There appears to be a strong correlation of n having only 0-3 prime factors in {2, 3, 5} if n! is zero-perfect. Uneven n is often a prime number if n! is zero-perfect.</p>