|
|
A036581
|
|
Ternary Thue-Morse sequence: closed under a->abc, b->ac, c->b.
|
|
5
|
|
|
0, 2, 1, 0, 1, 2, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 0, 1, 2, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 0, 1, 2, 0, 2, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
This sequence and A108694 are squarefree (they do not contain any substring XX). - Bill Gosper, Jul 22 2005
Trajectory of 1 under the morphism 0 -> 021, 1 -> 2 & 2 -> 01. - Robert G. Wilson v, Apr 06 2008
I believe that this is the sequence Cummings refers to as the Morse-Hedlund sequence. It can be constructed by starting with the Thue-Morse binary sequence A010060, 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,..., reading successive pairs of digits: 01, 11, 10, 01, 10, 00, 01, 11, 10, 00, 01, ..., and mapping 01 to 0, 10 to 1, and both 00 and 11 to 2, getting 0,2,1,0,1,2,0,2,1,... - N. J. A. Sloane, Oct 17 2012
|
|
REFERENCES
|
L. J. Cummings, On the construction of Thue sequences, Proc. 9th S-E Conf. Combinatorics, Graph Theory and Computing, pp. 235-242. - From N. J. A. Sloane, Oct 17 2012
M. Lothaire, Combinatorics on Words. Addison-Wesley, Reading, MA, 1983, p. 26.
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
% mod 3 ;
|
|
MATHEMATICA
|
Nest[ # /. {0 -> {0, 2, 1}, 1 -> {2}, 2 -> {0, 1}} &, {0}, 7] // Flatten (* Robert G. Wilson v, Apr 06 2008 *)
a010060[n_]:=Mod[DigitCount[n, 2, 1], 2]; Table[Mod[a010060[n + 1] - a010060[n] - 1, 3], {n, 0, 100}] (* Indranil Ghosh, Apr 25 2017 *)
SubstitutionSystem[{0->{0, 2, 1}, 1->{2}, 2->{0, 1}}, {0}, {7}][[1]] (* Harvey P. Dale, Dec 26 2021 *)
|
|
PROG
|
(Haskell)
a036581 n = a036581_list !! n
a036581_list = zipWith (\u v -> if u /= v then 2 * u + v - 1 else 2)
a010060_list $ tail a010060_list
(Python)
def a010060(n): return bin(n)[2:].count("1")%2
def a(n): return (a010060(n + 1) - a010060(n) - 1)%3 # Indranil Ghosh, Apr 25 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,nice,changed
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|