0
$\begingroup$

What is the total number of zeroes in $n!$?

I do not want to know the number of trailing zeroes in $n!$.

Let us take an example to understand what I want to know.

$7! = 5040$. The number of trailing zero in $7!$ is $1$. But the total number of zeroes in $7!$ is $2$.

I would like to know if there is any formula that gives me directly the total number of zeros in $n!$.

Can you help me derive one?

  • 1
    @Sultan In the english language, by convention, there is no space between a sentence and its ending punctuation, whether that's a period, a question mark, or an exclamation mark. There should also be no space before a colon, semicolon, or comma. The only punctuation mark that sometimes needs to be preceded by a space is a dash. I have edited the post making these changes.2012-12-29

2 Answers 2

2

Look at the answers and comments related to a similar question in this Mathoverflow link: https://mathoverflow.net/questions/102092/number-of-zeroes-in-100-factorial

1

You can use the Digit Count Algorithm.

Lets do a few examples using WolframAlpha.

Example 1: DigitCount[7!, 10, 0] results in 2.

Example 2: DigitCount[1000!, 10, 0] results in 472.

Example 3: DigitCount[123456!, 10, 0] results in 85245

Alternates for you to explore:

$(1)$ Do you see a way of constructing an algorithm that divides by the two prime numbers $2 ~~ and ~~ 5$ to count the number of zeros?

$(2)$ There are programs that convert an integer to a string and count the number of zeros, but you can look those up.

Regards

  • 0
    No zero votes allowed for my friend! +12013-05-10