|
|
A122840
|
|
a(n) is the number of 0's at the end of n when n is written in base 10.
|
|
46
|
|
|
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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,100
|
|
COMMENTS
|
Greatest k such that 10^k divides n.
a(n) = the number of digits in n - A160093(n).
The asymptotic density of the occurrences of k is 9/10^(k+1).
The asymptotic mean of this sequence is 1/9. (End)
|
|
LINKS
|
|
|
FORMULA
|
With m = floor(log_10(n)), frac(x) = x-floor(x):
a(n) = Sum_{j=1..m} (1 - ceiling(frac(n/10^j))).
a(n) = m + Sum_{j=1..m} (floor(-frac(n/10^j))).
G.f.: g(x) = Sum_{j>0} x^10^j/(1-x^10^j). (End)
|
|
EXAMPLE
|
a(160) = 1 because there is 1 zero at the end of 160 when 160 is written in base 10.
|
|
MATHEMATICA
|
a[n_] := IntegerExponent[n, 10]; Array[a, 100] (* Amiram Eldar, Mar 10 2021 *)
|
|
PROG
|
(Haskell)
a122840 n = if n < 10 then 0 ^ n else 0 ^ d * (a122840 n' + 1)
where (n', d) = divMod n 10
(Python)
def a(n): return len(str(n)) - len(str(int(str(n)[::-1]))) # Indranil Ghosh, Jun 09 2017
(Python)
(Python)
|
|
CROSSREFS
|
A007814 is the base 2 equivalent of this sequence.
Cf. A160094, A160093, A001511, A070940, A122841, A027868, A054899, A196563, A196564, A004151, A112765.
|
|
KEYWORD
|
nonn,base,easy,changed
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|