A378399 Rectangular array read by descending antidiagonals: (row 1) = u, and for n >= 2, (row n) = u-inverse runlength sequence of u, where u = A006337 (a Beatty difference sequence). See Comments.
1, 2, 2, 1, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2
Offset: 1
Examples
The corner of the array begins: 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 1 1 2 1 2 2 1 2 1 1 2 1 1 2 2 1 2 2 1 2 1 2 2 1 2 2 1 1 2 1 1 2 1 2 2 1 2 1 1 1 2 1 1 2 2 1 2 2 1 1 2 1 2 2 1 2 1 1 2 1 1 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 1 1 2 1 2 2 1 2 2 1 1 2 1 2 2 1 2 1 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 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 1 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 1 1 2 1 2 2 1 2 2 1 1 2 1 2 2 1 2 1 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 1
Programs
-
Mathematica
invRE[seq_, k_] := Flatten[Map[ConstantArray[#[[2]], #[[1]]] &, Partition[Riffle[seq, {k, 2 - Mod[k + 1, 2]}, {2, -1, 2}], 2]]]; row1 = Differences[Table[Floor[n*Sqrt[2]], {n, 1, 20}]] (* A006337 ); rows = {row1}; col = Take[row1, 12]; Do[AppendTo[rows, Take[invRE[Last[rows], col[[n]]], Length[row1]]], {n, 2, Length[col]}] rows // ColumnForm (* array *) w[n_, k_] := rows[[n]][[k]]; Table[w[n - k + 1, k], {n, 12}, {k, n, 1, -1}] // Flatten (* sequence *) (* Peter J. C. Moses, Nov 20 2024 *)
Comments