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

A380561 Rectangular array R read by descending antidiagonals: (row 1) = (R(1,k)) = (A006337(k)), k >= 1; (row n+1) = inverse runlength sequence of row n; and R(n,1) = (1, 1, 2, 1, 1, 2, 1, 1, 2, ...) = (A100063(n)) for n >= 1. See Comments.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jan 27 2025

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 the periodic sequence with period 1,1,2. There are three limiting sequences: A378283, A378284, A378285. No two rows are identical.
See A380560 for a guide to related sequences.

Examples

			Corner:
    1  2  1  2  1  1  2  1  2  1  1  2  1  2  1  2  1  1  2
    1  2  2  1  2  2  1  2  1  1  2  1  1  2  1  2  2  1  2
    2  1  1  2  2  1  2  2  1  1  2  1  1  2  1  2  2  1  2
    1  1  2  1  2  2  1  1  2  1  1  2  2  1  2  1  1  2  1
    1  2  1  1  2  1  1  2  2  1  2  1  1  2  1  2  2  1  1
    2  1  1  2  1  2  2  1  2  1  1  2  2  1  2  2  1  2  1
    1  1  2  1  2  2  1  2  2  1  1  2  1  1  2  1  2  2  1
    1  2  1  1  2  1  1  2  2  1  2  2  1  1  2  1  2  2  1
    2  1  1  2  1  2  2  1  2  1  1  2  2  1  2  2  1  1  2
		

Crossrefs

Cf. A000002, A100063 (column 1), A006337, A380560.

Programs

  • Mathematica
    invRE[seq_, k_] := Flatten[Map[ConstantArray[#[[2]], #[[1]]] &,
        Partition[Riffle[seq, {k, 2 - Mod[k + 1, 2]}, {2, -1, 2}], 2]]];
    row1 = Flatten[Table[Nest[Flatten[# /. {1 -> {1, 2}, 2 -> {1, 1, 2}}] &, {1},  n], {n, 3}]];(* A006337 *)
    rows = {row1};
    col = PadRight[{}, 30, {1, 1, 2}];
    Do[AppendTo[rows, Take[invRE[Last[rows], col[[n]]], Length[row1]]], {n, 2, Length[col]}]
    rows // ColumnForm  (* array *)
    v[n_, k_] := rows[[n]][[k]];
    Table[v[n - k + 1, k], {n, 12}, {k, n, 1, -1}] // Flatten (*sequence*)
    (* Peter J. C. Moses, Nov 20 2024 *)

A380562 Rectangular array R read by descending antidiagonals: (row 1) = (R(1,k)) = (A006337(k)), k >= 1; (row n+1) = inverse runlength sequence of row n; and R(n,1) = (1, 2, 2, 1, 2, 2, 1, 2, 2, ...) = (A130196(n)) for n >= 1. See Comments.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jan 27 2025

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 the periodic sequence with period 1,1,2. There are three limiting sequences: A378283, A378284, A378285. No two rows are identical.
See A380560 for a guide to related sequences.

Examples

			Corner:
    1  2  1  2  1  1  2  1  2  1  1  2  1  2  1  2  1  1  2
    2  1  1  2  1  1  2  1  2  2  1  2  2  1  2  1  1  2  1
    2  2  1  2  1  1  2  1  2  2  1  2  2  1  1  2  1  1  2
    1  1  2  2  1  2  2  1  2  1  1  2  1  1  2  2  1  2  2
    2  1  2  2  1  1  2  1  1  2  2  1  2  2  1  2  1  1  2
    2  2  1  2  2  1  1  2  1  2  2  1  2  1  1  2  2  1  2
    1  1  2  2  1  2  2  1  1  2  1  2  2  1  2  2  1  1  2
    2  1  2  2  1  1  2  1  1  2  2  1  2  1  1  2  1  1  2
    2  2  1  2  2  1  1  2  1  2  2  1  2  1  1  2  2  1  2
    1  1  2  2  1  2  2  1  1  2  1  2  2  1  2  2  1  1  2
		

Crossrefs

Cf. A000002, A130196 (column 1), A006337, A380560.

Programs

  • Mathematica
    invRE[seq_, k_] := Flatten[Map[ConstantArray[#[[2]], #[[1]]] &,
        Partition[Riffle[seq, {k, 2 - Mod[k + 1, 2]}, {2, -1, 2}], 2]]];
    row1 = Flatten[Table[Nest[Flatten[# /. {1 -> {1, 2}, 2 -> {1, 1, 2}}] &, {1}, n], {n, 3}]]; (* A006337 *)
    rows = {row1};
    col = PadRight[{}, 30, {1, 2, 2}];
    Do[AppendTo[rows, Take[invRE[Last[rows], col[[n]]], Length[row1]]], {n, 2, Length[col]}]
    rows // ColumnForm  (* array *)
    v[n_, k_] := rows[[n]][[k]];
    Table[v[n - k + 1, k], {n, 12}, {k, n, 1, -1}] // Flatten (*sequence*)
    (* Peter J. C. Moses, Nov 20 2024 *)

A380563 Rectangular array R read by descending antidiagonals: (row 1) = (R(1,k)) = (1 + A010060(k)), k >= 1; (row n+1) = inverse runlength sequence of row n; and R(n,1) = (1, 1, 1, 1, 1,...) = (A130196(n)) for n >= 1. See Comments.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jan 27 2025

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 the periodic sequence with period 1. The limiting sequence is A000002 (Kolakoski sequence). No two rows are identical.
Row 1: 1 + A010060; i.e., R(n,1) = 1 + n-th term op the Thue-Morse sequence.
See A380560 for a guide to related sequences.

Examples

			Corner:
1  2  2  1  2  1  1  2  2  1  1  2  1  2  2  1  2  1  1  2  1  2
1  2  2  1  1  2  1  1  2  1  2  2  1  1  2  1  2  2  1  2  2  1
1  2  2  1  1  2  1  2  2  1  2  1  1  2  1  1  2  2  1  2  1  1
1  2  2  1  1  2  1  2  2  1  2  2  1  1  2  1  1  2  1  2  2  1
1  2  2  1  1  2  1  2  2  1  2  2  1  1  2  1  1  2  2  1  2  1
1  2  2  1  1  2  1  2  2  1  2  2  1  1  2  1  1  2  2  1  2  1
		

Crossrefs

Cf. A000002, A000012 (column 1), A010060.

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 + ThueMorse[Range[0, 200]] (* 1 + A010060 *);
    rows = {row1};
    col = PadRight[{}, 30, {1}];
    Do[AppendTo[rows, Take[invRE[Last[rows], col[[n]]], Length[row1]]], {n, 2, Length[col]}]
    rows // ColumnForm  (* array *)
    v[n_, k_] := rows[[n]][[k]];
    Table[v[n - k + 1, k], {n, 12}, {k, n, 1, -1}] // Flatten  (*sequence*)
    (*Peter J.C.Moses,Nov 20 2024*)
Showing 1-3 of 3 results.