A112765 Exponent of highest power of 5 dividing n. Or, 5-adic valuation of n.
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
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Dario T. de Castro, P-adic Order of Positive Integers via Binomial Coefficients, INTEGERS, Electronic J. of Combinatorial Number Theory, Vol. 22, Paper A61, 2022.
- T. Lengyel, The order of the Fibonacci and Lucas numbers, Fibonacci Quart. 33 (1995), no. 3, 234-239. See Lemma 1 p. 235.
Crossrefs
Programs
-
Haskell
a112765 n = fives n 0 where fives n e | r > 0 = e | otherwise = fives n' (e + 1) where (n',r) = divMod n 5 -- Reinhard Zumkeller, Apr 08 2011
-
Maple
A112765 := proc(n) padic[ordp](n,5) ; end proc: # R. J. Mathar, Jul 12 2016
-
Mathematica
a[n_] := IntegerExponent[n, 5]; Array[a, 105] (* Jean-François Alcover, Jan 25 2018 *)
-
PARI
A112765(n)=valuation(n,5); /* Joerg Arndt, Apr 08 2011 */
-
Python
def a(n): k = 0 while n > 0 and n%5 == 0: n //= 5; k += 1 return k print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Aug 06 2021
Formula
Totally additive with a(p) = 1 if p = 5, 0 otherwise.
From Hieronymus Fischer, Jun 08 2012: (Start)
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)
a(5n) = A055457(n). - R. J. Mathar, Jul 17 2012
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
Comments