OFFSET
1,2
COMMENTS
Row n consists of 2n-1 positive integers.
EXAMPLE
First six rows:
1
3 2 1
5 6 4 2 1
7 10 10 6 4 2 1
9 14 16 14 9 6 4 2 1
11 18 22 22 19 12 9 6 4 2 1
For n=3, there are 6 triples (x,y,z) having x != y and y < z:
123: |x-y| + |y-z| = 2
212: |x-y| + |y-z| = 2
213: |x-y| + |y-z| = 3
312: |x-y| + |y-z| = 3
313: |x-y| + |y-z| = 4
323: |x-y| + |y-z| = 2
so row 2 of the array is (3,2,1), representing 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, 2, 2 n - 2}];
v = Flatten[u] (* sequence *)
Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 2, 2 n - 2}]] (* array *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Clark Kimberling, Jan 25 2024
STATUS
approved