|
|
A189664
|
|
Fixed point of the morphism 0->010, 1->001.
|
|
8
|
|
|
0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1
|
|
COMMENTS
|
a(n) is the parity of the number of ternary 1-digits below the lowest 0-digit in the ternary expansion of n-1. All fixed-width morphisms have a similar digital interpretation. - Kevin Ryde, Apr 26 2017
|
|
LINKS
|
|
|
FORMULA
|
a(3k-2)=0, a(3k-1)=1-a(k), a(3k)=a(k) for k>=1, a(0)=0.
|
|
EXAMPLE
|
Iterating the morphism starting with 0:
0: (#=1)
0
1: (#=3)
010
2: (#=9)
010001010
3: (#=27)
010001010010010001010001010
4: (#=81)
010001010010010001010001010010001010010001010010010001010001010010010001010001010
etc.
|
|
MATHEMATICA
|
t = Nest[Flatten[# /. {0->{0, 1, 0}, 1->{0, 0, 1}}] &, {0}, 5] (* A189664 *)
f[n_] := t[[n]]
Flatten[Position[t, 0]] (* A189665 *)
Flatten[Position[t, 1]] (* A189666 *)
s[n_] := Sum[f[i], {i, 1, n}]; s[0] = 0;
Table[s[n], {n, 1, 120}] (* A189667 *)
Nest[Flatten[# /. a_Integer -> {0, Abs[a - 1], a}] &, {0}, 5] (* Robert G. Wilson v, Jul 16 2012 *)
|
|
PROG
|
(PARI) a(n) = n--; my(ret=0); while(n%3, if(n%3==1, ret=!ret); n\=3); ret; /* Kevin Ryde, Jul 23 2019 */
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|