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.

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

This page as a plain text file.
%I A368516 #6 Jan 20 2024 09:46:16
%S A368516 2,6,4,2,10,12,8,4,2,14,20,20,12,8,4,2,18,28,32,28,18,12,8,4,2,22,36,
%T A368516 44,44,38,24,18,12,8,4,2,26,44,56,60,58,48,32,24,18,12,8,4,2,30,52,68,
%U A368516 76,78,72,60,40,32,24,18,12,8,4,2,34,60,80,92,98,96
%N A368516 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.
%C A368516 Row n consists of 2n-1 even positive integers.
%e A368516 First six rows:
%e A368516    2
%e A368516    6    4    2
%e A368516   10   12    8    4    2
%e A368516   14   20   20   12    8    4    2
%e A368516   18   28   32   28   18   12    8    4   2
%e A368516   22   36   44   44   38   24   18   12   8   4   2
%e A368516 For n=3, there are 12 triples (x,y,z) having x != y and y != z:
%e A368516   121:  |x-y| + |y-z| = 2
%e A368516   123:  |x-y| + |y-z| = 2
%e A368516   131:  |x-y| + |y-z| = 4
%e A368516   132:  |x-y| + |y-z| = 3
%e A368516   212:  |x-y| + |y-z| = 2
%e A368516   213:  |x-y| + |y-z| = 3
%e A368516   231:  |x-y| + |y-z| = 3
%e A368516   232:  |x-y| + |y-z| = 2
%e A368516   312:  |x-y| + |y-z| = 3
%e A368516   313:  |x-y| + |y-z| = 4
%e A368516   321:  |x-y| + |y-z| = 2
%e A368516   323:  |x-y| + |y-z| = 2,
%e A368516 so that row 2 of the array is (6,4,2), representing six 2s, four 3s, and two 4s.
%t A368516 t1[n_] := t1[n] = Tuples[Range[n], 3];
%t A368516 t[n_] := t[n] = Select[t1[n], #[[1]] != #[[2]] && #[[2]] != #[[3]] &];
%t A368516 a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &];
%t A368516 u = Table[Length[a[n, k]], {n, 2, 15}, {k, 2, 2 n - 2}]
%t A368516 v = Flatten[u];  (* sequence *)
%t A368516 Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 2, 2 n - 2}]]  (* array *)
%Y A368516 Cf. A011379 (row sums), A007590 (limiting reverse row), A368434, A368437, A368515, A368517, A368518, A368519, A368520, A368521, A368522.
%K A368516 nonn,tabf
%O A368516 1,1
%A A368516 _Clark Kimberling_, Dec 31 2023