OFFSET
1,3
COMMENTS
Row n consists of 2n positive integers.
EXAMPLE
First six rows:
1 1
2 3 2 1
3 5 5 4 2 1
4 7 8 8 6 4 2 1
5 9 11 12 11 9 6 4 2 1
6 11 14 16 16 15 12 9 6 4 2 1
For n=3, there are 8 triples (x,y,z) having x < y and y >= z:
121: |x-y| + |y-z| = 2
122: |x-y| + |y-z| = 1
131: |x-y| + |y-z| = 4
132: |x-y| + |y-z| = 3
133: |x-y| + |y-z| = 2
231: |x-y| + |y-z| = 3
232: |x-y| + |y-z| = 2
233: |x-y| + |y-z| = 1
so row 1 of the array is (2,3,2,1), representing two 1s, three 2s, two 3s, and one 4.
MATHEMATICA
t1[n_] := t1[n] = Tuples[Range[n], 3];
t[n_] := t[n] = Select[t1[n], #[[1]] < #[[2]] >= #[[3]] &];
a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &];
u = Table[Length[a[n, k]], {n, 2, 15}, {k, 1, 2 n - 2}];
v = Flatten[u] (* sequence *)
Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 1, 2 n - 2}]] ((* array *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Clark Kimberling, Jan 22 2024
STATUS
approved