|
|
A064990
|
|
If A_k denotes the first 3^k terms, then A_0 = 0, A_{k+1} = A_k A_k B_k, where B_k is obtained from A_k by interchanging 0's and 1's.
|
|
10
|
|
|
0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
Called the Mephisto Waltz sequence (or the Mephisto Waltz infinite word).
May also be obtained by starting with 0 and iterating the morphism 0 -> 001, 1 -> 110.
The sequence is fourth-power free.
The sequence gives A_oo. For the concatenation A_0, A_1, A_2, ... see A134391.
|
|
REFERENCES
|
J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 25.
Konrad Jacobs, Invitation to Mathematics, Princeton, 1992; pp. 105-106 and 215.
|
|
LINKS
|
|
|
FORMULA
|
a(3k-2)=a(k), a(3k-1)=a(k), a(3k)=1-a(k) for k>=1, a(0)=0.
|
|
EXAMPLE
|
Here are A_0 through A_5:
0
001
001001110
001001110001001110110110001
001001110001001110110110001001001110001001110110110001110110001110110001001001110
001001110001001110110110001001001110001001110110110001110110001110110001001001110\
00100111000100111011011000100100111000100111011011000111011000111011000100100111\
0110110001110110001001001110110110001110110001001001110001001110001001110110110001
|
|
MAPLE
|
with(ListTools);
f2:=proc(S) map(x->x+1 mod 2, S); end;
f:=proc(S) global f2;
[op(S), op(S), op(f2(S))]; end;
S:=[0];
for n from 1 to 6 do S:=f(S): od:
|
|
MATHEMATICA
|
t = Nest[Flatten[# /. {0->{0, 0, 1}, 1->{1, 1, 0}}] &, {0}, 5] (*A064990*)
f[n_] := t[[n]]
Flatten[Position[t, 0]] (*A189658*)
Flatten[Position[t, 1]] (*A189659*)
s[n_] := Sum[f[i], {i, 1, n}]; s[0] = 0;
Table[s[n], {n, 1, 120}] (*A189660*)
(* by Clark Kimberling, Apr 25 2011 *)
Nest[ Flatten[# /. # -> {#, #, Abs[# - 1]}] &, {0}, 5] (* Robert G. Wilson v, Sep 27 2011 *)
SubstitutionSystem[{0->{0, 0, 1}, 1->{1, 1, 0}}, {0}, {5}][[1]] (* Harvey P. Dale, Jan 25 2022 *)
|
|
PROG
|
(PARI) a(n) = vecsum(digits(n, 3)>>1)%2; \\ Kevin Ryde, Jun 02 2020
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,nice
|
|
AUTHOR
|
Michael Gilleland (megilleland(AT)yahoo.com), Oct 31 2001
|
|
EXTENSIONS
|
Corrected by N. J. A. Sloane, Jun 14 2010, at the suggestion of Chris Erickson
|
|
STATUS
|
approved
|
|
|
|