OFFSET
0,6
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..999
FORMULA
From Michel Marcus, Sep 14 2021: (Start)
a(n) = Sum_{i=1..n} i*v_5(i), where v_5(i) = A112765(i) is the exponent of the highest power of 5 dividing i. After a similar formula in A249152. (End)
a(n) = A246817(floor(n/5)+1). - Jason Bard, Sep 06 2025
MATHEMATICA
(n=#; k=0; While[Mod[n, 10]==0, n=n/10; k++]; k)&/@Hyperfactorial@Range[0, 60] (* Giorgos Kalogeropoulos, Sep 14 2021 *)
PROG
(Python)
def a(n):
s = 1
for k in range(n+1):
s *= k**k
i = 1
while not s % 10**i:
i += 1
return i-1
n = 1
while n < 100:
print(a(n), end=', ')
n += 1 # Derek Orr, Sep 04 2014
(Python)
from sympy import multiplicity
A246839, p5 = [0, 0, 0, 0, 0], 0
for n in range(5, 10**3, 5):
p5 += multiplicity(5, n)*n
A246839.extend([p5]*5)
# Chai Wah Wu, Sep 05 2014
(PARI) a(n) = sum(i=1, n, i*valuation(i, 5)); \\ Michel Marcus, Sep 14 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Chai Wah Wu, Sep 04 2014
STATUS
approved
