cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A122840 a(n) is the number of 0's at the end of n when n is written in base 10.

This page as a plain text file.
%I A122840 #58 Apr 08 2024 18:54:21
%S A122840 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,
%T A122840 0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
%U A122840 0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0
%N A122840 a(n) is the number of 0's at the end of n when n is written in base 10.
%C A122840 Greatest k such that 10^k divides n.
%C A122840 a(n) = the number of digits in n - A160093(n).
%C A122840 a(A005117(n)) <= 1. - _Reinhard Zumkeller_, Mar 30 2010
%C A122840 See A054899 for the partial sums. - _Hieronymus Fischer_, Jun 08 2012
%C A122840 From _Amiram Eldar_, Mar 10 2021: (Start)
%C A122840 The asymptotic density of the occurrences of k is 9/10^(k+1).
%C A122840 The asymptotic mean of this sequence is 1/9. (End)
%H A122840 Reinhard Zumkeller, <a href="/A122840/b122840.txt">Table of n, a(n) for n = 1..10000</a>
%H A122840 S. Ikeda and K. Matsuoka, <a href="http://siauliaims.su.lt/pdfai/2013/Iked-Mats-2013.pdf">On transcendental numbers generated by certain integer sequences</a>, Siauliai Math. Semin., 8 (16) 2013, 63-69.
%F A122840 a(n) = A160094(n) - 1.
%F A122840 From _Hieronymus Fischer_, Jun 08 2012: (Start)
%F A122840 With m = floor(log_10(n)), frac(x) = x-floor(x):
%F A122840 a(n) = Sum_{j=1..m} (1 - ceiling(frac(n/10^j))).
%F A122840 a(n) = m + Sum_{j=1..m} (floor(-frac(n/10^j))).
%F A122840 a(n) = A054899(n) - A054899(n-1).
%F A122840 G.f.: g(x) = Sum_{j>0} x^10^j/(1-x^10^j). (End)
%F A122840 a(n) = min(A007814(n), A112765(n)). - _Jianing Song_, Jul 23 2022
%e A122840 a(160) = 1 because there is 1 zero at the end of 160 when 160 is written in base 10.
%t A122840 a[n_] := IntegerExponent[n, 10]; Array[a, 100] (* _Amiram Eldar_, Mar 10 2021 *)
%o A122840 (Haskell)
%o A122840 a122840 n = if n < 10 then 0 ^ n else 0 ^ d * (a122840 n' + 1)
%o A122840             where (n', d) = divMod n 10
%o A122840 -- _Reinhard Zumkeller_, Mar 09 2013
%o A122840 (PARI) a(n)=valuation(n,10) \\ _Charles R Greathouse IV_, Feb 26 2014
%o A122840 (Python)
%o A122840 def a(n): return len(str(n)) - len(str(int(str(n)[::-1]))) # _Indranil Ghosh_, Jun 09 2017
%o A122840 (Python)
%o A122840 def A122840(n): return len(s:=str(n))-len(s.rstrip('0')) # _Chai Wah Wu_, Jul 06 2022
%o A122840 (Python)
%o A122840 A122840 = lambda n: sympy.multiplicity(10,n) # _M. F. Hasler_, Apr 05 2024
%Y A122840 A007814 is the base 2 equivalent of this sequence.
%Y A122840 Cf. A160094, A160093, A001511, A070940, A122841, A027868, A054899, A196563, A196564, A004151, A112765.
%K A122840 nonn,base,easy
%O A122840 1,100
%A A122840 _Reinhard Zumkeller_, Sep 13 2006