OFFSET
1,1
COMMENTS
Row n consists of 2n positive integers.
EXAMPLE
First six rows:
2 1
4 5 2 1
6 9 8 4 2 1
8 13 14 12 6 4 2 1
10 17 20 20 16 9 6 4 2 1
12 21 26 28 26 21 12 9 6 4 2 1
For n=2, there are 3 triples (x,y,z) having x != y and y <= z:
122: |x-y| + |y-z| = 1
211: |x-y| + |y-z| = 1
212: |x-y| + |y-z| = 2
so row 2 of the array is (2,1), representing two 1s and one 2.
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 25 2024
STATUS
approved