%I #14 Jul 08 2020 01:25:19
%S 0,1,2,0,2,1,0,1,2,1,0,2,0,1,2,0,2,1,0,2,0,1,2,1,0,1,2,0,2,1,0,1,2,1,
%T 0,2,0,1,2,1,0,1,2,0,2,1,0,2,0,1,2,0,2,1,0,1,2,1,0,2,0,1,2,0,2,1,0,2,
%U 0,1,2,1,0,1,2,0,2,1,0,2,0,1,2,0,2,1,0,1,2,1,0,2,0,1,2,1,0,1,2
%N Ternary Thue-Morse sequence: closed under a->abc, b->ac, c->b.
%C 0 is a, 1 is b and 2 is c. - _Robert G. Wilson v_, Jul 30 2018
%D M. Lothaire, Combinatorics on Words. Addison-Wesley, Reading, MA, 1983, p. 26.
%H Marko Milosevic and Narad Rampersad, <a href="https://arxiv.org/abs/2007.03557">Squarefree words with interior disposable factors</a>, arXiv:2007.03557 [math.CO], 2020.
%H Michaël Rao, Michel Rigo, Pavel Salimov, <a href="https://arxiv.org/abs/1310.4743">Avoiding 2-binomial squares and cubes</a>, arXiv:1310.4743 [cs.FL], 2013.
%H Michaël Rao, Michel Rigo, Pavel Salimov, <a href="https://doi.org/10.1016/j.tcs.2015.01.029">Avoiding 2-binomial squares and cubes</a>, Theoretical Computer Science, Volume 572, 23 March 2015, Pages 83-91.
%t Nest[Flatten[# /. {0 -> {0, 1, 2}, 1 -> {0, 2}, 2 -> {1}}] &, {1}, 7] (* _Robert G. Wilson v_, Jul 30 2018 *)
%Y A007413(n+1) - 1.
%Y See A036577 for another version.
%K nonn
%O 0,3
%A _N. J. A. Sloane_.