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.
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
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).
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 *)
Comments