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.

A368521 Triangular array T, read by rows: T(n,k) = number of sums |x-y| + |y-z| - |x-z| = k, where x,y,z are in {1,2,...,n}.

This page as a plain text file.
%I A368521 #10 Jan 29 2024 11:01:54
%S A368521 1,6,2,17,8,2,36,18,8,2,65,32,18,8,2,106,50,32,18,8,2,161,72,50,32,18,
%T A368521 8,2,232,98,72,50,32,18,8,2,321,128,98,72,50,32,18,8,2,430,162,128,98,
%U A368521 72,50,32,18,8,2,561,200,162,128,98,72,50,32,18,8,2,716
%N A368521 Triangular array T, read by rows: T(n,k) = number of sums |x-y| + |y-z| - |x-z| = k, where x,y,z are in {1,2,...,n}.
%e A368521 First eight rows:
%e A368521    1
%e A368521    6    2
%e A368521   17    8    2
%e A368521   36   18    8    2
%e A368521   65   32   18    8    2
%e A368521  106   50   32   18    8    2
%e A368521  161   72   50   32   18    8    2
%e A368521  232   98   72   50   32   18    8    2
%e A368521 For n=2, there are 8 triples (x,y,z):
%e A368521   111:  |x-y| + |y-z| - |x-z| = 0
%e A368521   112:  |x-y| + |y-z| - |x-z| = 0
%e A368521   121:  |x-y| + |y-z| - |x-z| = 2
%e A368521   122:  |x-y| + |y-z| - |x-z| = 0
%e A368521   211:  |x-y| + |y-z| - |x-z| = 0
%e A368521   212:  |x-y| + |y-z| - |x-z| = 2
%e A368521   221:  |x-y| + |y-z| - |x-z| = 0
%e A368521   222:  |x-y| + |y-z| - |x-z| = 0
%e A368521 so row 2 of the array is (6,2), representing six 0s and two 2s.
%t A368521 t[n_] := t[n] = Tuples[Range[n], 3]
%t A368521 a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] - Abs[#[[1]] - #[[3]]] ==  k &]
%t A368521 u = Table[Length[a[n, k]], {n, 1, 15}, {k, 0, 2 n - 2, 2}]
%t A368521 v = Flatten[u] (* sequence *)
%t A368521 Column[Table[Length[a[n, k]], {n, 1, 15}, {k, 0, 2 n - 2, 2}]]  (* array *)
%Y A368521 Cf. A084990 (column 1), A000578 (row sums), A001105 (limiting reversed row), A368434, A368437, A368515, A368516, A368517, A368518, A368519, A368520, A368522, A368604, A368605, A368606, A368607, A368609.
%K A368521 nonn,tabl
%O A368521 1,2
%A A368521 _Clark Kimberling_, Jan 25 2024