This is known as the trailing zeros problem.

This function will answer the question for any ,

Results 1 to 3 of 3

- September 13th 2008, 01:40 PM #1

- Joined
- Nov 2006
- Posts
- 152

## N!

For a positive integer, , we define N! (read N factorial) to

be the product of all the integers from 1 to N. Thus:

It is clear that N! will end in a zero if N is larger or equal to

5. For big values of N, N! will end in many, many zeros.

How many zeros will end in?

- September 13th 2008, 02:16 PM #2

- September 13th 2008, 05:35 PM #3

- Joined
- May 2006
- From
- Lexington, MA (USA)
- Posts
- 12,026
- Thanks
- 842

Hello, perash!

For a positive integer, , we define N! (read N factorial)

to be the product of all the integers from 1 to N.

Thus: .

It is clear that will end in a zero if .

For large values of will end in many, many zeros.

How many zeros will end in?

Plato is absolutely correct . . . Here's the basis of that formula . . .

Every factor of 5 (paired with an even factor) will produce a final zero.

The question becomes: how many 5's are in the prime factorization of ?

Every fifth number has a factor of 5.

. . Hence, there are: . factors of 5.

But every twenty-fifth number has a factor of

. . Each of them contributes*one more 5*to the total.

And there are: . of them.

Hence, contains: factors of 5

Therefore, ends in eighteen zeros.