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.

Showing 1-4 of 4 results.

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

A322423 Start with (1, 2, 3); when the sequence has n terms, extend it by appending a(n) copies of a(1..n-1). (Cf. "Look to the left" sequence A293630.)

Original entry on oeis.org

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

Views

Author

Iain Fox, Dec 07 2018

Keywords

Examples

			Sequence starts with 1, 2, 3.  Then 3 copies of 1, 2 are appended, giving 1, 2, 3, 1, 2, 1, 2, 1, 2.  Then 2 copies of everything but the final entry 2 are appended, giving 9 + 8 + 8 + 8 = 33 terms.
		

Crossrefs

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

Programs

  • Mathematica
    Nest[Join[#, Flatten@ ConstantArray[Drop[#, -1], #[[-1]]] ] &, {1, 2, 3}, 4] (* Michael De Vlieger, Dec 08 2018 *)
  • PARI
    gen(n, v=[1,2,3], w) = for(x=1, n, w=vector(#v-1, i, v[i]); for(y=1, v[#v], v=concat(v, w))); v

Formula

Lim_{n->infinity} (a(1) + a(2) + ... + a(n))/n = 1.64948851...

Extensions

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

A322424 Start with (1, 2, 3, 4); when the sequence has n terms, extend it by appending a(n) copies of a(1..n-1). (Cf. "Look to the left" sequence A293630.)

Original entry on oeis.org

1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3
Offset: 1

Views

Author

Iain Fox, Dec 07 2018

Keywords

Examples

			Sequence starts with 1, 2, 3, 4.  Then 4 copies of 1, 2, 3 are appended, giving 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3.  Then 3 copies of everything but the final entry 3 are appended, giving 16 + 15 + 15 + 15 = 61 terms.
		

Crossrefs

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

Programs

  • Mathematica
    Nest[Join[#, Flatten@ ConstantArray[Drop[#, -1], #[[-1]]] ] &, Range@ 4, 3] (* Michael De Vlieger, Dec 08 2018 *)
  • PARI
    gen(n, v=[1,2,3,4], w) = for(x=1, n, w=vector(#v-1, i, v[i]); for(y=1, v[#v], v=concat(v, w))); v

Formula

Lim_{n->infinity} (a(1) + a(2) + ... + a(n))/n = 2.08405776...

Extensions

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

A322426 Array read by downwards antidiagonals: A(n, k) is the k-th term of a "Look to the left" sequence starting with 1,2,...,n (see A293630).

Original entry on oeis.org

1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 1, 1, 3, 2, 1, 2, 2, 4, 3, 2, 1, 1, 1, 1, 4, 3, 2, 1, 1, 2, 2, 5, 4, 3, 2, 1, 2, 1, 3, 1, 5, 4, 3, 2, 1, 1, 2, 1, 2, 6, 5, 4, 3, 2, 1, 1, 1, 2, 3, 1, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 2, 7, 6, 5, 4, 3, 2, 1, 2, 3, 1, 1, 3, 1, 7, 6, 5
Offset: 2

Views

Author

Iain Fox, Dec 07 2018

Keywords

Examples

			| n\k |  1   2   3   4   5   6   7   8   9  10  11  12  13  ...
|-----|-----------------------------------------------------------
|  2  |  1,  2,  1,  1,  1,  2,  1,  1,  2,  1,  1,  1,  2, ...
|  3  |  1,  2,  3,  1,  2,  1,  2,  1,  2,  1,  2,  3,  1, ...
|  4  |  1,  2,  3,  4,  1,  2,  3,  1,  2,  3,  1,  2,  3, ...
|  5  |  1,  2,  3,  4,  5,  1,  2,  3,  4,  1,  2,  3,  4, ...
|  6  |  1,  2,  3,  4,  5,  6,  1,  2,  3,  4,  5,  1,  2, ...
|  7  |  1,  2,  3,  4,  5,  6,  7,  1,  2,  3,  4,  5,  6, ...
|  8  |  1,  2,  3,  4,  5,  6,  7,  8,  1,  2,  3,  4,  5, ...
| ... |
		

Crossrefs

n-th row: A293630 (n=2), A322423 (n=3), A322424 (n=4), A322425 (n=5).

Programs

  • PARI
    row(n, k) = my(v=vector(n, i, i), w); while(#v
    				

Formula

If k <= n, A(n, k) = k.
Showing 1-4 of 4 results.