login
A368158
Irregular triangular array T, read by rows: T(n,k) = number of sums |x-y| + |y-z| = k, where x,y,z are in {1,2,...,n} and x <= y.
0
2, 3, 1, 3, 6, 6, 2, 1, 4, 9, 11, 9, 4, 2, 1, 5, 12, 16, 16, 13, 6, 4, 2, 1, 6, 15, 21, 23, 22, 17, 9, 6, 4, 2, 1, 7, 18, 26, 30, 31, 28, 22, 12, 9, 6, 4, 2, 1, 8, 21, 31, 37, 40, 39, 35, 27, 16, 12, 9, 6, 4, 2, 1, 9, 24, 36, 44, 49, 50, 48, 42, 33, 20, 16
OFFSET
1,1
COMMENTS
Row n consists of 2n+1 positive integers.
EXAMPLE
First six rows:
2 3 1
3 6 6 2 1
4 9 11 9 4 2 1
5 12 16 16 13 6 4 2 1
6 15 21 23 22 17 9 6 4 2 1
7 18 26 30 31 28 22 12 9 6 4 2 1
For n=2, there are 6 triples (x,y,z) having x <= y:
111: |x-y| + |y-z| = 0
112: |x-y| + |y-z| = 1
121: |x-y| + |y-z| = 2
122: |x-y| + |y-z| = 1
221: |x-y| + |y-z| = 1
222: |x-y| + |y-z| = 0,
so row 1 of the array is (2,3,1), representing two 0s, three 1s, and one 1.
MATHEMATICA
t1[n_] := t1[n] = Tuples[Range[n], 3];
t[n_] := t[n] = Select[t1[n], #[[1]] < #[[2]] &];
a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &];
u = Table[Length[a[n, k]], {n, 2, 15}, {k, 0, 2 n - 2}];
v = Flatten[u] (* sequence *)
Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 0, 2 n - 2}]] (* array *)
CROSSREFS
Cf. A002411 (row sums), A002620 (limiting reverse row), A368434, A368437, A368515, A368516, A368517, A368519, A368520, A368521, A368522.
Sequence in context: A101912 A208522 A209569 * A176850 A208516 A111808
KEYWORD
nonn,tabf
AUTHOR
Clark Kimberling, Jan 20 2024
STATUS
approved