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 A368158 #7 Jan 22 2024 00:02:26 %S A368158 2,3,1,3,6,6,2,1,4,9,11,9,4,2,1,5,12,16,16,13,6,4,2,1,6,15,21,23,22, %T A368158 17,9,6,4,2,1,7,18,26,30,31,28,22,12,9,6,4,2,1,8,21,31,37,40,39,35,27, %U A368158 16,12,9,6,4,2,1,9,24,36,44,49,50,48,42,33,20,16 %N A368158 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 A368158 Row n consists of 2n+1 positive integers. %e A368158 First six rows: %e A368158 2 3 1 %e A368158 3 6 6 2 1 %e A368158 4 9 11 9 4 2 1 %e A368158 5 12 16 16 13 6 4 2 1 %e A368158 6 15 21 23 22 17 9 6 4 2 1 %e A368158 7 18 26 30 31 28 22 12 9 6 4 2 1 %e A368158 For n=2, there are 6 triples (x,y,z) having x <= y: %e A368158 111: |x-y| + |y-z| = 0 %e A368158 112: |x-y| + |y-z| = 1 %e A368158 121: |x-y| + |y-z| = 2 %e A368158 122: |x-y| + |y-z| = 1 %e A368158 221: |x-y| + |y-z| = 1 %e A368158 222: |x-y| + |y-z| = 0, %e A368158 so row 1 of the array is (2,3,1), representing two 0s, three 1s, and one 1. %t A368158 t1[n_] := t1[n] = Tuples[Range[n], 3]; %t A368158 t[n_] := t[n] = Select[t1[n], #[[1]] < #[[2]] &]; %t A368158 a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &]; %t A368158 u = Table[Length[a[n, k]], {n, 2, 15}, {k, 0, 2 n - 2}]; %t A368158 v = Flatten[u] (* sequence *) %t A368158 Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 0, 2 n - 2}]] (* array *) %Y A368158 Cf. A002411 (row sums), A002620 (limiting reverse row), A368434, A368437, A368515, A368516, A368517, A368519, A368520, A368521, A368522. %K A368158 nonn,tabf %O A368158 1,1 %A A368158 _Clark Kimberling_, Jan 20 2024