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.
%I A368522 #9 Jan 29 2024 11:01:30 %S A368522 1,2,6,2,8,17,2,8,18,36,2,8,18,32,65,2,8,18,32,50,106,2,8,18,32,50,72, %T A368522 161,2,8,18,32,50,72,98,232,2,8,18,32,50,72,98,128,321,2,8,18,32,50, %U A368522 72,98,128,162,430,2,8,18,32,50,72,98,128,162,200,561,2 %N A368522 Triangular array T, read by rows: T(n,k) = number of sums |x-y| + |y-z| - |x-z| = 2n-2-k, where x,y,z are in {1,2,...,n}. %C A368522 The rows are the reversals of the rows in A368521. %e A368522 First eight rows: %e A368522 1 %e A368522 2 6 %e A368522 2 8 17 %e A368522 2 8 18 36 %e A368522 2 8 18 32 65 %e A368522 2 8 18 32 50 106 %e A368522 2 8 18 32 50 72 161 %e A368522 2 8 18 32 50 72 98 232 %e A368522 For n=2, there are 8 triples (x,y,z): %e A368522 111: |x-y| + |y-z| - |x-z| = 0 %e A368522 112: |x-y| + |y-z| - |x-z| = 0 %e A368522 121: |x-y| + |y-z| - |x-z| = 2 %e A368522 122: |x-y| + |y-z| - |x-z| = 0 %e A368522 211: |x-y| + |y-z| - |x-z| = 0 %e A368522 212: |x-y| + |y-z| - |x-z| = 2 %e A368522 221: |x-y| + |y-z| - |x-z| = 0 %e A368522 222: |x-y| + |y-z| - |x-z| = 0 %e A368522 so row 2 of the array is (2,6), representing two 2s and six 0s. %t A368522 t[n_] := t[n] = Tuples[Range[n], 3] %t A368522 a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] %t A368522 - Abs[#[[1]] - #[[3]]] == 2n-2-k &] %t A368522 u = Table[Length[a[n, k]], {n, 1, 15}, {k, 0, 2 n - 2, 2}] %t A368522 v = Flatten[u] (* sequence *) %t A368522 Column[Table[Length[a[n, k]], {n, 1, 15}, {k, 0, 2 n - 2, 2}]] (* array *) %Y A368522 Cf. A084990 (column 1), A000578 (row sums), A001105 (limiting row), A368521. %K A368522 nonn,tabl %O A368522 1,2 %A A368522 _Clark Kimberling_, Jan 25 2024