OFFSET
1,4
COMMENTS
The difference sequence of the k-th column is (k), for k >= 1.
EXAMPLE
First nine rows:
0
1 0
2 2 1
3 4 4 2
4 6 7 6 4
5 8 10 10 9 6
6 10 13 14 14 12 9
7 12 16 18 19 18 16 12
8 14 19 22 24 24 23 20 16
For n=3, there are 5 triples (x,y,z) having x < y and y > z:
121: |x-y| + |y-z| = 2
131: |x-y| + |y-z| = 4
132: |x-y| + |y-z| = 3
231: |x-y| + |y-z| = 3
232: |x-y| + |y-z| = 2
so that row 1 of the array is (2,2,1), representing two 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, 1, 15}, {k, 2, n + 1}];
v = Flatten[u]
Column[Table[Length[a[n, k]], {n, 1, 15}, {k, 2, n + 1}]]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Clark Kimberling, Jan 22 2024
STATUS
approved