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.

A378282 Irregular triangular T: (row 1) = (1); (row n+1) = inverse runlength sequence of row n, starting with 2 if r = 3k for some k, and 1 otherwise. See Comments.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Dec 08 2024

Keywords

Comments

For present purposes, all sequences to be considered consist entirely of 1s and 2s. If u and v are such sequences (infinite or finite), we call v an inverse runlength sequence of u if u is the runlength sequence of v. Each u has two inverse runlength sequences, one with first term 1 and the other with first term 2. Consequently, an inverse runlength array, in which each row after the first is an inverse runlength sequence of the preceding row, is determined by its first column. In this array, the first column is periodic with period 1,1,2. As a result, the array has three limiting sequences: A378283, A378284, A378285.
Generally, if the first column is periodic with fundamental period p, then the array has p distinct limiting sequences; otherwise, there is no limiting sequence; however, if a segment, of any length, occurs in a row, then it also occurs in a subsequent row.
This guide is a table of four columns:
col 1: (row 1 of A)
col 2: fundamental period of column 1 of A
col 3: limiting sequence of array (possibly several)
col 4: runlength sequence of sequence in column 3
***
col 1 col 2 col 3 col 4
(1) (1,2) A025142 A025143
(2) (2,1) A025143 A025142
(1) (1,1,2) A378283 A378285
(1) (1,2,1) A378284 A378283
(2) (2,1,1) A378285 A378284
(1) (1,1,2) A378304 A378306
(2) (2,1,2) A378305 A378304
(2) (2,2,1) A378306 A378305

Examples

			First eleven rows:
  1
  1
  2
  1  1
  1  2
  2  1  1
  1  1  2  1
  1  2  1  1  2
  2  1  1  2  1  2  2
  1  1  2  1  2  2  1  2  2  1  1
  1  2  1  1  2  1  1  2  2  1  2  2  1  1  2  2  1
(row 8) = (1,2,1,1,2) has runlength sequence (1,1,2,1) = (row 7).
		

Crossrefs

Cf. A270641, A378284, A378285, A378286 (row lengths).

Programs

  • Mathematica
    invRE[seq_, k_] := Flatten[Map[ConstantArray[#[[2]], #[[1]]] &,
        Partition[Riffle[seq, {k, 2 - Mod[k + 1, 2]}, {2, -1, 2}], 2]]];
    row1 = {1}; rows = {row1};
    col = PadRight[{}, 18, {1, 1, 2}]
    Do[AppendTo[rows, invRE[Last[rows], col[[n]]]], {n, 2, Length[col]}]
    rows // ColumnForm  (* array *)
    Flatten[rows]  (* sequence *)
    (* Peter J. C. Moses, Nov 21 2024 *)