%I #35 Apr 21 2020 15:26:04
%S 1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,
%T 1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,
%U 1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,1,2,1,2,2,1,2,1,2
%N Limit of the sequence of words defined by w(1) = 1, w(2) = 1221, and w(n) = w(n-1) 2 w(n-2) 2 w(n-1) for n >= 2. Also the fixed point of the map 1 -> 122, 2 -> 12.
%D Allombert, Bill, Nicolas Brisebarre, and Alain Lasjaunias. "On a two-valued sequence and related continued fractions in power series fields." The Ramanujan Journal 45.3 (2018): 859-871. See W in Theorem 2.
%H Alain Lasjaunias and Jia-Yan Yao, <a href="https://www.math.u-bordeaux.fr/~alasjaun/HcfAs.pdf">Hyperquadratic continued fractions and automatic sequences</a>, Finite Fields and Their Applications 40 (2016) 46-60. See Section 4.
%H Claude Lenormand, <a href="/A318921/a318921.pdf">Deux transformations sur les mots</a>, Preprint, 5 pages, Nov 17 2003. Apparently unpublished. This is a scanned copy of the version that the author sent to me in 2003. The sequence is on page 1, but there is a typo in the definition: g(1)=112 should be g(1)=122.
%t Nest[Flatten[#]/.{1->{1,2,2},2->{1,2}}&,{1},6]//Flatten (* _Harvey P. Dale_, Apr 21 2020 *)
%Y Equals A189687(n) + 1.
%Y For runs, see A318930.
%Y For w(n) see A328991.
%K nonn
%O 1,2
%A _Jeffrey Shallit_, Dec 21 2016