number of zeroes in 100 factorial

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!:

$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 $

Which simplifies to:

$t = \lfloor \frac{n (9 \ln (10)-4)+4 (n-9) \ln (n)+2 \ln(2 \Pi n)}{40 \ln(10)} \rfloor$

This approximation seems to work well for n up to at least 10,000.

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.

98! is "zero-perfect", i.e. inside zeroes appear with exactly frequency $1/10$, with actual total zero count 35 and $t = 35$

Other examples of zero-perfect factorials are: 1009!, 1097!, 1112!, 2993!, 6128!, ....

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.


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.

Gerhard "Willing To Formalize The Bet" Paseman, 2012.07.12


EDIT: this doesn't really work. I'm still a good human being.

Evenly enough, it seems possible to get the number of zeros in the binary expansion of $n!$

One can get a fairly accurate expression for $$\log_2 \; n! = \frac{\log \; n!}{\log 2}$$ from using extra terms in Stirling's formula. Taking the floor of that and adding 1 gives the total number of digits in base two..

Legendre's formula $$ v_2(n!) = \left\lfloor \frac{n}{2} \right\rfloor + \left\lfloor \frac{n}{4} \right\rfloor + \cdots $$ has a companion,

$$ 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.$

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.