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.

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

This page as a plain text file.
%I A378303 #5 Dec 21 2024 01:05:49
%S A378303 1,2,2,2,1,1,2,2,2,1,2,2,1,1,2,2,1,2,2,1,1,2,1,1,1,2,2,1,2,2,1,1,2,1,
%T A378303 2,2,1,2,1,2,2,1,1,2,1,1,2,2,1,2,1,1,2,1,1,2,2,1,2,2,1,2,2,1,1,2,1,2,
%U A378303 2,1,2,1,1,2,2,1,2,2,1,2,1,1,2,1,2,2
%N A378303 Irregular triangular T: (row 1) = (1); (row n+1) = inverse runlength sequence of row n, starting with 1 if r = 3k for some k, and  2 otherwise. See Comments.
%C A378303 See A378282 for a guide to related arrays and sequences.
%e A378303 First nine rows:
%e A378303    1
%e A378303    2
%e A378303    2, 2
%e A378303    1, 1, 2, 2
%e A378303    2, 1, 2, 2, 1, 1
%e A378303    2, 2, 1, 2, 2, 1, 1, 2, 1
%e A378303    1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1
%e A378303    2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1
%e A378303    2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2
%e A378303 (row 9) = (2,2,1,2,2,1,...) has runlength sequence (2,1,2,2,...) = (row 8).
%t A378303 invRE[seq_, k_] := Flatten[Map[ConstantArray[#[[2]], #[[1]]] &,
%t A378303     Partition[Riffle[seq, {k, 2 - Mod[k + 1, 2]}, {2, -1, 2}], 2]]];
%t A378303 row1 = {1}; rows = {row1};
%t A378303 col = PadRight[{}, 18, {1, 2, 2}]
%t A378303 Do[AppendTo[rows, invRE[Last[rows], col[[n]]]], {n, 2, Length[col]}]
%t A378303 rows // ColumnForm  (* array *)
%t A378303 Flatten[rows]  (* sequence *)
%t A378303 (* _Peter J. C. Moses_, Nov 21 2024 *)
%Y A378303 Cf. A378282, A378304, A378305, A378306, A378307 (row lengths)
%K A378303 nonn,tabf
%O A378303 1,2
%A A378303 _Clark Kimberling_, Dec 20 2024