|
|
A253786
|
|
a(3n) = 0, a(3n+1) = 0, a(3n+2) = 1 + a(n+1).
|
|
11
|
|
|
0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 4, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 5
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,6
|
|
COMMENTS
|
For n >= 1, a(n) gives the distance of n in square array A191450 from its leftmost column.
The sequence 0,1,0,0,0,2,0,...,i.e., (a(n)) with the first term removed, is the unique fixed point of the constant length 3 morphism N -> 0 N+1 0 on the infinite alphabet {0,1,...,N,...}. - Michel Dekking, Sep 09 2022
a(n) is the number of trailing 1 digits of n-1 written in ternary, for n>=1. - Kevin Ryde, Sep 09 2022
|
|
LINKS
|
|
|
FORMULA
|
Other identities and observations. For all n >= 1:
For all n >= 1:
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/2. - Amiram Eldar, Nov 16 2023
|
|
MATHEMATICA
|
With[{nmax=200}, IntegerExponent[2Range[0, nmax]-1, 3]] (* Paolo Xausa, Nov 09 2023 *)
|
|
PROG
|
(Scheme, with memoization-macro definec)
(definec (A253786 n) (if (= 2 (modulo n 3)) (+ 1 (A253786 (/ (+ 1 n) 3))) 0))
(PARI) a(n) = n--; my(ret=0, r); while([n, r]=divrem(n, 3); r==1, ret++); ret; \\ Kevin Ryde, Sep 13 2022
|
|
CROSSREFS
|
Cf. A007814, A007949, A048673, A064216, A135523, A191450 (A254051), A253887, A253894, A254045, A254103, A254104, A245611.
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|