cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A293630 "Look to the left" sequence starting with (1, 2): when the sequence has n terms, extend it by appending a(n) copies of a(1..n-1).

Original entry on oeis.org

1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2
Offset: 1

Views

Author

Benoit Cloitre, Oct 14 2017

Keywords

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.

Crossrefs

"Look to the left" sequences: A322423 (seed 1,2,3), A322424 (seed 1,2,3,4), A322425 (seed 1,2,3,4,5).

Programs

  • 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 *)
  • 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];

Formula

It seems that lim_{n->infinity} (a(1) + a(2) + ... + a(n))/n = 1.27526... (see link and A296564).
Because of the previous statement, it seems that the ratio of 2s to 1s in this sequence is 1:2.6329... (see A297927). - Iain Fox, Oct 15 2017

Extensions

Self-contained name from M. F. Hasler, Dec 10 2018