OFFSET
1,1
COMMENTS
Row n consists of 2n-1 positive integers.
EXAMPLE
First six rows:
2
4 3 2
6 6 8 2 2
8 9 14 9 6 2 2
10 12 20 16 16 6 6 2 2
12 15 26 23 26 17 12 6 6 2 2
For n=3, there are 9 triples (x,y,z) having x < z:
112: |x-y| + |y-z| = 1
113: |x-y| + |y-z| = 2
122: |x-y| + |y-z| = 1
123: |x-y| + |y-z| = 2
132: |x-y| + |y-z| = 3
133: |x-y| + |y-z| = 2
213: |x-y| + |y-z| = 3
223: |x-y| + |y-z| = 1
233: |x-y| + |y-z| = 1,
so that row 1 of the array is (4,3,2), representing four 1s, three 2s, and two 3s.
MATHEMATICA
t1[n_] := t1[n] = Tuples[Range[n], 3];
t[n_] := t[n] = Select[t1[n], #[[1]] < #[[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 - 3}];
v = Flatten[u]; (* sequence *)
Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 1, 2 n - 3}]] (* array *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Clark Kimberling, Jan 22 2024
STATUS
approved