%I M0140 #42 Feb 18 2024 03:53:49
%S 2,1,3,2,3,1,2,1,3,1,2,3,2,1,3,2,3,1,2,3,2,1,3,1,2,1,3,2,3,1,2,1,3,1,
%T 2,3,2,1,3,1,2,1,3,2,3,1,2,3,2,1,3,2,3,1,2,1,3,1,2,3,2,1,3,2,3,1,2,3,
%U 2,1,3,1,2,1,3,2,3,1,2,3,2,1,3,2,3,1,2,1,3,1,2,3,2,1,3,1,2,1,3,2,3,1,2,1,3
%N A squarefree (or Thue-Morse) ternary sequence: closed under a->abc, b->ac, c->b.
%C Fixed point of the morphism 1 -> 23, 2 -> 213 & 3 -> 1. - _Robert G. Wilson v_, Apr 06 2008
%C Replacing all 4's in A005681 with 1's yields this sequence. - _Sean A. Irvine_, Aug 04 2016
%D A. Salomaa, Jewels of Formal Language Theory. Computer Science Press, Rockville, MD, 1981, p. 10.
%D G. Siebert, personal communication.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Marston Morse and Gustav A. Hedlund, <a href="https://doi.org/10.1215/S0012-7094-44-01101-4">Unending chess, symbolic dynamics and a problem in semigroups</a>, Duke Math. J., Volume 11, Number 1 (1944), 1-7.
%H G. Siebert, <a href="/A001285/a001285_1.pdf">Letter to N. J. A. Sloane, Sept. 1977</a>.
%H <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>
%t Nest[ # /. {1 -> {2, 3}, 2 -> {2, 1, 3}, 3 -> 1} &, {2}, 7] // Flatten (* _Robert G. Wilson v_, Apr 06 2008 *)
%t SubstitutionSystem[{1->{2,3},2->{2,1,3},3->{1}},{2},{7}][[1]] (* _Harvey P. Dale_, Jul 14 2022 *)
%Y Cf. A005681.
%K nonn,easy,nice
%O 1,1
%A _N. J. A. Sloane_
%E More terms from _Robert G. Wilson v_, Apr 06 2008