login
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

%I #7 Jan 22 2024 00:02:26

%S 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,

%T 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,

%U 16,12,9,6,4,2,1,9,24,36,44,49,50,48,42,33,20,16

%N 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.

%C Row n consists of 2n+1 positive integers.

%e First six rows:

%e 2 3 1

%e 3 6 6 2 1

%e 4 9 11 9 4 2 1

%e 5 12 16 16 13 6 4 2 1

%e 6 15 21 23 22 17 9 6 4 2 1

%e 7 18 26 30 31 28 22 12 9 6 4 2 1

%e For n=2, there are 6 triples (x,y,z) having x <= y:

%e 111: |x-y| + |y-z| = 0

%e 112: |x-y| + |y-z| = 1

%e 121: |x-y| + |y-z| = 2

%e 122: |x-y| + |y-z| = 1

%e 221: |x-y| + |y-z| = 1

%e 222: |x-y| + |y-z| = 0,

%e so row 1 of the array is (2,3,1), representing two 0s, three 1s, and one 1.

%t t1[n_] := t1[n] = Tuples[Range[n], 3];

%t t[n_] := t[n] = Select[t1[n], #[[1]] < #[[2]] &];

%t a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &];

%t u = Table[Length[a[n, k]], {n, 2, 15}, {k, 0, 2 n - 2}];

%t v = Flatten[u] (* sequence *)

%t Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 0, 2 n - 2}]] (* array *)

%Y Cf. A002411 (row sums), A002620 (limiting reverse row), A368434, A368437, A368515, A368516, A368517, A368519, A368520, A368521, A368522.

%K nonn,tabf

%O 1,1

%A _Clark Kimberling_, Jan 20 2024