login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual Appeal: Today, Nov 11 2014, is the 4th anniversary of the launch of the new OEIS web site. 70,000 sequences have been added in these four years, all edited by volunteers. Please make a donation (tax deductible in the US) to help keep the OEIS running.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A027868 Number of trailing zeros in n!; highest power of 5 dividing n!. 58
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 19 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,11

COMMENTS

Also the highest power of 10 dividing n! (different from A054899). - Hieronymus Fischer, Jun 18 2007

a(n) = (n - A053824(n))/4. - Lekraj Beedassy, Nov 01 2010

Alternatively, a(n) equals the expansion of the base-5 representation A007091(n) of n (i.e., where successive positions from right to left stand for 5^n or A000351(n)) under a scale of notation whose successive positions from right to left stand for (5^n - 1)/4 or A003463(n); for instance, n = 7392 has base-5 expression 2*5^5 + 1*5^4 + 4*5^3 + 0*5^2 + 3*5^1 + 2*5^0, so that a(7392) = 2*781 + 1*156 + 4*31 + 0*6 + 3*1 + 2*0 = 1845. - Lekraj Beedassy, Nov 03 2010

Partial sums of A112765. - Hieronymus Fischer, Jun 06 2012

10^a(n) = A000142(n) / A004154(n). - Reinhard Zumkeller, Nov 24 2012

LINKS

T. D. Noe and Hieronymus Fischer, Table of n, a(n) for n = 0..10000 (first 1000 terms from T. D. Noe)

David S. Hart, James E. Marengo, Darren A. Narayan and David S. Ross, On the number of trailing zeros in n!, College Math. J., 39(2):139-145, 2008.

Enrique Pérez Herrero, Trailing Zeros inn! , Psychedelic Geometry Blogspot.

S. Ikeda, K. Matsuoka, On transcendental numbers generated by certain integer sequences, Siauliai Math. Semin., 8 (16) 2013, 63-69.

A. M. Oller-Marcén. A new look at the trailing zeroes of n!, arXiv:0906.4868v1 [math.NT].

Eric Weisstein's World of Mathematics, Factorial

Index entries for sequences related to factorial numbers

FORMULA

a(n) = sum(i>=1, floor( n/5^i ) ).

a(n) = (n-A053824(n))/4.

From Hieronymus Fischer, Jun 25 2007 and Aug 13 2007: (Start)

G.f.: g(x) = sum{k>0, x^(5^k)/(1-x^(5^k))}/(1-x).

a(n) = sum{5<=k<=n, sum{j|k, j>=5, floor(log_5(j)) - floor(log_5(j-1))}}.

G.f.: g(x) = L[b(k)](x)/(1-x)

where L[b(k)](x) = sum{k>=0, b(k)*x^k/(1-x^k)} is a Lambert series with b(k) = 1, if k>1 is a power of 5, else b(k) = 0.

G.f.: g(x) = sum{k>0, c(k)*x^k}/(1-x),

where c(k) = sum{j>1, j|k, floor(log_5(j)) - floor(log_5(j - 1))}.

Recurrence:

a(n) = floor(n/5) + a(floor(n/5));

a(5*n) = n + a(n);

a(n*5^m) = n*(5^m-1)/4 + a(n).

a(k*5^m) = k*(5^m-1)/4, for 0<=k<5, m>=0.

Asymptotic behavior:

a(n) = n/4 + O(log(n)),

a(n+1) - a(n) = O(log(n)), which follows from the inequalities below.

a(n) <= (n-1)/4; equality holds for powers of 5.

a(n) >= n/4 - 1 - floor(log_5(n)); equality holds for n=5^m-1, m>0.

lim inf (n/4 - a(n)) = 1/4, for n-->oo.

lim sup (n/4 - log_5(n) - a(n)) = 0, for n-->oo.

lim sup (a(n+1) - a(n) - log_5(n)) = 0, for n-->oo.

(End)

a(n) <= A027869(n). - Reinhard Zumkeller, Jan 27 2008

EXAMPLE

a(100)  = 24.

a(10^3) = 249.

a(10^4) = 2499.

a(10^5) = 24999.

a(10^6) = 249998.

a(10^7) = 2499999.

a(10^8) = 24999999.

a(10^9) = 249999998.

MAPLE

0, seq(add(floor(n/5^i), i=1..floor(log[5](n))), n=1..100); # Robert Israel, Nov 13 2014

MATHEMATICA

Table[t = 0; p = 5; While[s = Floor[n/p]; t = t + s; s > 0, p *= 5]; t, {n, 0, 100} ]

Table[ IntegerExponent[n!], {n, 0, 80}] (* Robert G. Wilson v *)

PROG

(Haskell)

a027868 n = sum $ takeWhile (> 0) $ map (n `div`) $ tail a000351_list

-- Reinhard Zumkeller, Oct 31 2012

(PARI) a(n)=my(s); while(n, s+=n\=5); s \\ Charles R Greathouse IV, Nov 08 2012

(PARI) a(n)=valuation(n!, 5) \\ Charles R Greathouse IV, Nov 08 2012

(Python)

from sympy import multiplicity

A027868, p5 = [0, 0, 0, 0, 0], 0

for n in range(5, 10**3, 5):

....p5 += multiplicity(5, n)

....A027868.extend([p5]*5) # Chai Wah Wu, Sep 05 2014

CROSSREFS

See A000966 for the missing numbers. Cf. A011371 and A054861 for analogues involving powers of 2 and 3.

Cf. A054899, A007953, A112765, A067080, A098844, A132027, A067080, A098844, A132029, A054999, A112765, A191610, A000351.

Sequence in context: A154099 A105511 A187183 * A060384 A105564 A241766

Adjacent sequences:  A027865 A027866 A027867 * A027869 A027870 A027871

KEYWORD

nonn,base,nice,easy

AUTHOR

Warut Roonguthai

EXTENSIONS

Examples added by Hieronymus Fischer, Jun 06 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified December 22 06:09 EST 2014. Contains 252328 sequences.