login
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.
8
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, 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, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2
OFFSET
1,2
COMMENTS
See A378282 for a guide to related arrays and sequences.
EXAMPLE
First nine rows:
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, 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, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2
(row 9) = (2,2,1,2,2,1,...) has runlength sequence (2,1,2,2,...) = (row 8).
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, 2, 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 *)
CROSSREFS
Cf. A378282, A378304, A378305, A378306, A378307 (row lengths)
Sequence in context: A037811 A091237 A143477 * A214774 A320107 A190321
KEYWORD
nonn,tabf
AUTHOR
Clark Kimberling, Dec 20 2024
STATUS
approved