I was on Math.Stack Exchange 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 were 24 zeroes. However, that are 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.



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.


