|
|
A112765
|
|
Exponent of highest power of 5 dividing n. Or, 5-adic valuation of n.
|
|
50
|
|
|
0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,25
|
|
COMMENTS
|
This is also the 5-adic valuation of Fibonacci(n). See Lengyel link. - Michel Marcus, May 06 2017
|
|
LINKS
|
|
|
FORMULA
|
Totally additive with a(p) = 1 if p = 5, 0 otherwise.
With m = floor(log_5(n)), frac(x) = x-floor(x):
a(n) = Sum_{j=1..m} (1 - ceiling(frac(n/5^j))).
a(n) = m + Sum_{j=1..m} (floor(-frac(n/5^j))).
G.f.: Sum_{j>0} x^5^j/(1-x^5^j). (End)
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/4. - Amiram Eldar, Feb 14 2021
a(n) = 5*Sum_{j=1..floor(log(n)/log(5))} frac(binomial(n, 5^j)*5^(j-1)/n). - Dario T. de Castro, Jul 10 2022
|
|
MAPLE
|
padic[ordp](n, 5) ;
|
|
MATHEMATICA
|
|
|
PROG
|
(Haskell)
a112765 n = fives n 0 where
fives n e | r > 0 = e
| otherwise = fives n' (e + 1) where (n', r) = divMod n 5
(Python)
def a(n):
k = 0
while n > 0 and n%5 == 0: n //= 5; k += 1
return k
|
|
CROSSREFS
|
Cf. A007814, A007949, A112762, A022337, A122840, A027868, A054899, A122841, A160093, A160094, A196563, A196564.
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|