login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A293811
"Look twice to the left" sequence starting with 1,2 (see comment).
1
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, 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, 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
OFFSET
1,2
COMMENTS
Stage 0: we start from 1,2.
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.
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.
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.
Iterate the process.
MATHEMATICA
Nest[Join[#, Flatten@ ConstantArray[Take[#, Length@ # - 1], 2]] &, {1, 2}, 5] (* Michael De Vlieger, Oct 16 2017 *)
PROG
(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];
CROSSREFS
Cf. A293630.
Sequence in context: A374327 A368473 A106035 * A362228 A105141 A103961
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Oct 16 2017
STATUS
approved