%I #84 Jul 23 2022 14:53:53
%S 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,
%T 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,
%U 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
%N Exponent of highest power of 5 dividing n. Or, 5-adic valuation of n.
%C A027868 gives partial sums.
%C This is also the 5-adic valuation of Fibonacci(n). See Lengyel link. - _Michel Marcus_, May 06 2017
%H Reinhard Zumkeller, <a href="/A112765/b112765.txt">Table of n, a(n) for n = 1..10000</a>
%H Dario T. de Castro, <a href="http://math.colgate.edu/~integers/w61/w61.pdf">P-adic Order of Positive Integers via Binomial Coefficients</a>, INTEGERS, Electronic J. of Combinatorial Number Theory, Vol. 22, Paper A61, 2022.
%H T. Lengyel, <a href="http://www.fq.math.ca/Scanned/33-3/lengyel.pdf">The order of the Fibonacci and Lucas numbers</a>, Fibonacci Quart. 33 (1995), no. 3, 234-239. See Lemma 1 p. 235.
%F Totally additive with a(p) = 1 if p = 5, 0 otherwise.
%F From _Hieronymus Fischer_, Jun 08 2012: (Start)
%F With m = floor(log_5(n)), frac(x) = x-floor(x):
%F a(n) = Sum_{j=1..m} (1 - ceiling(frac(n/5^j))).
%F a(n) = m + Sum_{j=1..m} (floor(-frac(n/5^j))).
%F a(n) = A027868(n) - A027868(n-1).
%F G.f.: Sum_{j>0} x^5^j/(1-x^5^j). (End)
%F a(5n) = A055457(n). - _R. J. Mathar_, Jul 17 2012
%F Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/4. - _Amiram Eldar_, Feb 14 2021
%F 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
%p A112765 := proc(n)
%p padic[ordp](n,5) ;
%p end proc: # _R. J. Mathar_, Jul 12 2016
%t a[n_] := IntegerExponent[n, 5]; Array[a, 105] (* _Jean-François Alcover_, Jan 25 2018 *)
%o (Haskell)
%o a112765 n = fives n 0 where
%o fives n e | r > 0 = e
%o | otherwise = fives n' (e + 1) where (n',r) = divMod n 5
%o -- _Reinhard Zumkeller_, Apr 08 2011
%o (PARI) A112765(n)=valuation(n,5); /* _Joerg Arndt_, Apr 08 2011 */
%o (Python)
%o def a(n):
%o k = 0
%o while n > 0 and n%5 == 0: n //= 5; k += 1
%o return k
%o print([a(n) for n in range(1, 106)]) # _Michael S. Branicky_, Aug 06 2021
%Y Cf. A007814, A007949, A112762, A022337, A122840, A027868, A054899, A122841, A160093, A160094, A196563, A196564.
%Y Cf. A343251.
%K nonn,easy
%O 1,25
%A _Reinhard Zumkeller_, Sep 18 2005