cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A368604 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.

This page as a plain text file.
%I A368604 #11 May 02 2024 15:15:16
%S A368604 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,
%T A368604 16,18,19,18,16,12,8,14,19,22,24,24,23,20,16,9,16,22,26,29,30,30,28,
%U A368604 25,20,10,18,25,30,34,36,37,36,34,30,25,11,20,28,34,39
%N A368604 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.
%C A368604 The difference sequence of the k-th column is (k), for k >= 1.
%e A368604 First nine rows:
%e A368604   0
%e A368604   1    0
%e A368604   2    2    1
%e A368604   3    4    4    2
%e A368604   4    6    7    6    4
%e A368604   5    8   10   10    9    6
%e A368604   6   10   13   14   14   12    9
%e A368604   7   12   16   18   19   18   16   12
%e A368604   8   14   19   22   24   24   23   20   16
%e A368604 For n=3, there are 5 triples (x,y,z) having x < y and y > z:
%e A368604 121:  |x-y| + |y-z| = 2
%e A368604 131:  |x-y| + |y-z| = 4
%e A368604 132:  |x-y| + |y-z| = 3
%e A368604 231:  |x-y| + |y-z| = 3
%e A368604 232:  |x-y| + |y-z| = 2
%e A368604 so that row 1 of the array is (2,2,1), representing two 2s, two 3s, and one 4.
%t A368604 t1[n_] := t1[n] = Tuples[Range[n], 3];
%t A368604 t[n_] := t[n] = Select[t1[n], #[[1]] < #[[2]] > #[[3]] &];
%t A368604 a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &];
%t A368604 u = Table[Length[a[n, k]], {n, 1, 15}, {k, 2, n + 1}];
%t A368604 v = Flatten[u]
%t A368604 Column[Table[Length[a[n, k]], {n, 1, 15}, {k, 2, n + 1}]]
%Y A368604 Cf. A000027 (column 1), A002620 (T(n,n)), A002717 (row sums), A368434, A368437, A368515, A368516, A368517, A368518, A368519, A368521, A368522.
%K A368604 nonn,tabl
%O A368604 1,4
%A A368604 _Clark Kimberling_, Jan 22 2024