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.

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

This page as a plain text file.
%I A368517 #6 Jan 20 2024 09:46:25
%S A368517 1,1,2,4,2,1,3,7,7,4,2,1,4,10,12,11,6,4,2,1,5,13,17,18,15,9,6,4,2,1,6,
%T A368517 16,22,25,24,20,12,9,6,4,2,1,7,19,27,32,33,31,25,16,12,9,6,4,2,1,8,22,
%U A368517 32,39,42,42,38,31,20,16,12,9,6,4,2,1,9,25,37
%N A368517 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 A368517 Row n consists of 2n positive integers.
%e A368517 First eight rows:
%e A368517   1   1
%e A368517   2   4   2   1
%e A368517   3   7   7   4   2   1
%e A368517   4  10  12  11   6   4   2   1
%e A368517   5  13  17  18  15   9   6   4   2   1
%e A368517   6  16  22  25  24  20  12   9   6   4   2  1
%e A368517   7  19  27  32  33  31  25  16  12   9   6  4  2  1
%e A368517   8  22  32  39  42  42  38  31  20  16  12  9  6  4  2  1
%e A368517 For n=3, there are 9 triples (x,y,z) having x < y:
%e A368517   121:  |x-y| + |y-z| = 2
%e A368517   122:  |x-y| + |y-z| = 1
%e A368517   123:  |x-y| + |y-z| = 2
%e A368517   131:  |x-y| + |y-z| = 4
%e A368517   132:  |x-y| + |y-z| = 3
%e A368517   133:  |x-y| + |y-z| = 2
%e A368517   231:  |x-y| + |y-z| = 3
%e A368517   232:  |x-y| + |y-z| = 2
%e A368517   233:  |x-y| + |y-z| = 1,
%e A368517 so that row 2 of the array is (2,4,2,1), representing two 1s, four 2s, two 3s, and one 4.
%t A368517 t1[n_] := t1[n] = Tuples[Range[n], 3];
%t A368517 t[n_] := t[n] = Select[t1[n], #[[1]] < #[[2]] &];
%t A368517 a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &];
%t A368517 u = Table[Length[a[n, k]], {n, 2, 15}, {k, 1, 2 n - 2}];
%t A368517 v = Flatten[u]  (* sequence *)
%t A368517 Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 1, 2 n - 2}]]  (* array *)
%Y A368517 Cf. A006002 (row sums), A002620 (limiting reverse row), A368434, A368437, A368515, A368516, A368518, A368519, A368520, A368521, A368522.
%K A368517 nonn,tabf
%O A368517 1,3
%A A368517 _Clark Kimberling_, Dec 31 2023