OFFSET
1,5
COMMENTS
Highest power of 5 dividing prime(n)! = A039716(n), or also the number of trailing end 0's in A039716(n). - Lekraj Beedassy, Oct 31 2010
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{k=1..L} floor(prime(n)/5^k), where L = log(p_n)/log(5).
MAPLE
R:= NULL: v:= 0: p:= 0:
for i from 1 to 100 do
q:= p;
p:= nextprime(p);
v:= v + add(1+padic:-ordp(x, 5), x = 1+floor(q/5) .. floor(p/5));
R:= R, v;
od:
R; # Robert Israel, Sep 27 2023
MATHEMATICA
lst={}; Do[p=Prime[n]; s=0; While[p>1, p=IntegerPart[p/5]; s+=p; ]; AppendTo[lst, s], {n, 5!}]; lst (* Vladimir Joseph Stephan Orlovsky, Jul 28 2009 *)
PROG
(PARI) a(n) = valuation(prime(n)!, 5); \\ Michel Marcus, Jan 15 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jan 26 2003
STATUS
approved