login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A368608
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 and y <= z.
0
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, 14, 25, 32, 36, 36, 33, 26, 16, 12, 9, 6, 4, 2, 1, 16, 29, 38, 44, 46, 45, 40, 32, 20, 16, 12, 9, 6, 4, 2, 1, 18, 33
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
Cf. A005443 (column 1), A027480 (row sums), A002620 (limiting reversed row), A368434, A368437, A368515, A368516, A368517, A368518, A368519, A368520, A368521, A368522, A368604, A368605, A368606, A368607, A368609.
Sequence in context: A370181 A248666 A162407 * A352458 A132741 A072436
KEYWORD
nonn,tabf
AUTHOR
Clark Kimberling, Jan 25 2024
STATUS
approved