**BEHAVIOR OF THE PERCENTAJE OF TRAILING ZEROS IN THE DECIMAL EXPANSION OF n!**

*It was many and many a year ago, In a kingdom by the sea *, I spent a very good time reading an spanish translation of Martin Gardner´s **“Mathematical Magic Show”** [1] , just because Annabel was not very much interested on me.

In this compilation from Scientific American, Gardner dedicated some pages to this topic in an article called **“Factorial Oddities”.**

Gardner explained how, as increases, is having more and more factors including the prime factor , that with other factors with any it gives ´s that accumulates in the decimal expansion of creating a long tail of zeros [2] that fill the least significant digits of this kind of huge numbers.

As it is possible to calculate this number of trailing zeros without having to expand the whole factorial, I wondered (when I was sixteen) if this final zeros were giving very much information about the digits of the whole factorial number or not.

To answer this question, it is necessary to study the behaviour of the percentage between the trailing zeros and the total number of digits of when tends to infinity.

**Number of Digits of n!:** [3]

**Exponent of p in the prime factorization of n!: (Legendre´s formula)**

**Number of Trailing Zeros in n!.** (See sequence [2])

**PTZ(n!) = Percentage of trailing zeros of the total digits in n! **(%)

But if we want to test the limit of we need to work more handy bounds of this functions, notated with an added asterisk, and that they are going to hold for:

**Approximation for the Number of Digits of n!:**

We can sustitute the famous Stirling’s approximation instead of in the formula for :

The last formula gives the exact value for the number of digits of , for , because the error for the Stirling´s formula is

But for our purposes we must make some changes inside to get a continuous lower bound:

**Approximation for the Legendre´s formula and for the Number of Trailing Zeros:**

**Final Result and Limit:**

is always positive and it is upper bounded by a continuos function that tend to zero as tends to infinity.

So the number of trailing zeros of is giving lesser information about the decimal digits of when the more grows

This result may not cause any surprise, but long time ago I had a lot of fun when I was able to prove and plot it.

This ideas does not finish here, but on the contrary there are many many things than can be derived from this introductory point, and that are going to be material for further development in this blog.

**References:**

[1]-Gardner, M. “Factorial Oddities.” Ch. 4 in Mathematical Magic Show: More Puzzles, Games, Diversions, Illusions and Other Mathematical Sleight-of-Mind from Scientific American. New York: Vintage, pp. 50-65, 1978

[2]-A027868-Number of trailing zeros in n! The On-Line Encyclopedia of Integer Sequences!

[3]-A055642-Number of digits in decimal expansion of n. The On-Line Encyclopedia of Integer Sequences!

[5]-Trailing Zero @ Wikipedia

[6]-Stapel, Elizabeth. “Factorials and Trailing Zeroes.” Purplemath. Available from

http://www.purplemath.com/modules/factzero.htm

[7]-A061010-Number of digits in (10^n)!. The On-Line Encyclopedia of Integer Sequences!

**Archives:**
[a]-121209-Number of Trailing Zeros of n!.nb