OFFSET
1,2
COMMENTS
Stage 1: last term of 1,2 is 2 hence we add 2 copies of the block to the left of the last term (here 1) giving 1,2,1,1.
Stage 2: last term of 1,2,1,1 is 1 hence we add one copy of the block to the left of the last term (here 1,2,1) giving 1,2,1,1,1,2,1.
Stage 3: last term of 1,2,1,1,1,2,1 is 1 hence we add one copy of the block to the left of the last term (here 1,2,1,1,1,2) giving 1,2,1,1,1,2,1,1,2,1,1,1,2.
Iterate the process.
LINKS
Iain Fox, Table of n, a(n) for n = 1..10369
Benoit Cloitre, Plot of Sum_{k=1..n} a(k)/n
FORMULA
MATHEMATICA
f[s_List] := Block[{a = Flatten[s][[-1]], b = Most@ s}, s = Join[s, Flatten@ Table[b, {a}]]]; Nest[f, {1, 2}, 6] (* Robert G. Wilson v, Dec 23 2017 *)
PROG
(PARI) v=[1, 2]; for(n=1, 10, l=length(v); w=vector(l-1, i, v[i]); v=concat(v, if(v[l]-1, concat(w, w), w))); a(n)=v[n];
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Benoit Cloitre, Oct 14 2017
EXTENSIONS
Self-contained name from M. F. Hasler, Dec 10 2018
STATUS
approved