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-2 of 2 results.

A381587 a(1) = 1; thereafter the sequence is extended by iteratively appending the run length transform of the reverse of the sequence thus far.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Feb 27 2025

Keywords

Comments

The run length transform replaces each run of consecutive equal values with a single value representing the length of that run.
Is 2 the greatest even number in the sequence?
It appears that the limit of the rows read in reverse equals A306346 (ignoring the initial terms). - Paul D. Hanna, Mar 03 2025

Examples

			Irregular triangle begins:
  1;
  1;
  2;
  1,2;
  1,1,1,2;
  1,3,1,1,1,2;
  1,3,1,1,1,3,1,1,1,2;
  1,3,1,3,1,1,1,3,1,1,1,3,1,1,1,2;
  1,3,1,3,1,3,1,1,1,1,1,3,1,3,1,1,1,3,1,1,1,3,1,1,1,2;
  ...
		

Crossrefs

Cf. A381357 (row lengths), A381358 (row sums), A381356 (limit of rows), A306346.
Cf. A306211.

Programs

  • PARI
    \\ From Paul D. Hanna, Mar 03 2025: (Start)
    \\ RUNS(V) Returns vector of run lengths in vector V:
    {RUNS(V) = my(R=[],c=1);if(#V>1, for(n=2,#V, if(V[n]==V[n-1], c=c+1, R=concat(R,c); c=1))); R=concat(R,c)}
    \\ REV(V) Reverses order of vector V:
    {REV(V) = Vec(Polrev(Ser(V)))}
    \\ Generates N rows as a vector A of row vectors
    {N=15; A=vector(N);A[1]=[1];A[2]=[1];A[3]=[2];
    for(n=3,#A-1, A[n+1] = concat(RUNS(REV(A[n])),A[n]);); A}
    for(n=1,N,print(A[n])) \\ Print N rows of this triangle (End)

A381356 Limit of rows in irregular triangle A381587.

Original entry on oeis.org

1, 3, 1, 3, 1, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 7, 1, 3, 1, 1, 1, 1, 1, 7, 1, 1, 1, 5, 1, 3, 1, 1, 1, 1, 1, 7, 1, 1, 1, 3, 1, 5, 1, 1, 1, 5, 1, 3, 1, 1, 1, 1, 1, 7, 1, 1, 1, 3, 1, 1, 1, 3, 1, 5, 1, 1, 1, 3, 1, 5, 1, 1, 1, 5, 1, 3, 1, 1, 1, 1, 1, 7, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 5
Offset: 1

Views

Author

Paul D. Hanna, Mar 03 2025

Keywords

Comments

This sequence appears to equal the RUNS transform of A306346.

Examples

			Row n+1 of irregular triangle A381587 equals the run lengths of the first n rows of the triangle (flattened) when read in reverse order, starting with
n = 1: [1];
n = 2: [1];
n = 3: [2];
n = 4: [1, 2];
n = 5: [1, 1, 1, 2];
n = 6: [1, 3, 1, 1, 1, 2];
n = 7: [1, 3, 1, 1, 1, 3, 1, 1, 1, 2];
n = 8: [1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 2];
n = 9: [1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 2];
n = 10: [1, 3, 1, 3, 1, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 2];
n = 11: [1, 3, 1, 3, 1, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 7, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 2];
n = 12: [1, 3, 1, 3, 1, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 7, 1, 3, 1, 1, 1, 1, 1, 7, 1, 1, 1, 5, 1, 3, 1, 1, 1, 1, 1, 1, ...];
...
This sequence gives the limit of the rows.
		

Crossrefs

Programs

  • PARI
    \\ Print the limit of the rows in triangle A381587
    \\ RUNS(V) Returns vector of run lengths in vector V:
    {RUNS(V) = my(R=[], c=1); if(#V>1, for(n=2, #V, if(V[n]==V[n-1], c=c+1, R=concat(R, c); c=1))); R=concat(R, c)}
    \\ REV(V) Reverses order of vector V:
    {REV(V) = Vec(Polrev(Ser(V)))}
    \\ Generates N rows as a vector A of row vectors.
    {N=25; A=vector(N); A[1]=[1]; A[2]=[1]; A[3]=[2];
    for(n=3, #A-1, A[n+1] = concat(RUNS(REV(A[n])), A[n]); );}
    \\ Print the initial terms of the limit of the rows
    \\ (row 25 has 10797 terms of the limit of rows sequence)
    for(n=1,120, print1(A[25][n],", "))
Showing 1-2 of 2 results.