login
"Look twice to the left" sequence starting with 1,2 (see comment).
1

%I #8 Oct 20 2017 14:32:17

%S 1,2,1,1,1,2,1,1,2,1,1,2,1,1,1,2,1,1,2,1,2,1,1,1,2,1,1,2,1,2,1,1,1,2,

%T 1,1,2,1,1,2,1,1,1,2,1,1,2,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,2,1,1,2,1,

%U 1,1,2,1,1,2,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,2,1,1,2,1,1,1,2,1,1

%N "Look twice to the left" sequence starting with 1,2 (see comment).

%C Stage 0: we start from 1,2.

%C Stage 1: we add 2 copies of the block to the left of the last term (here the block 1) giving 1,2,1,1.

%C Stage 2: we add 2 copies of the block to the left of the last term (here the block 1,2,1) giving 1,2,1,1,1,2,1,1,2,1.

%C Stage 3: we add 2 copies of the block to the left of the last term (here the block 1,2,1,1,1,2,1,1,2) giving 1,2,1,1,1,2,1,1,2,1,1,2,1,1,1,2,1,1,2,1,2,1,1,1,2,1,1,2.

%C Iterate the process.

%t Nest[Join[#, Flatten@ ConstantArray[Take[#, Length@ # - 1], 2]] &, {1, 2}, 5] (* _Michael De Vlieger_, Oct 16 2017 *)

%o (PARI) v=[1,2];for(n=1,10,l=length(v);w=vector(l-1,i,v[i]);v=concat(v,concat(w,w)));a(n)=v[n];

%Y Cf. A293630.

%K nonn

%O 1,2

%A _Benoit Cloitre_, Oct 16 2017