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 A368607 #8 Jan 29 2024 11:01:43 %S A368607 1,3,2,1,5,6,4,2,1,7,10,10,6,4,2,1,9,14,16,14,9,6,4,2,1,11,18,22,22, %T A368607 19,12,9,6,4,2,1,13,22,28,30,29,24,16,12,9,6,4,2,1,15,26,34,38,39,36, %U A368607 30,20,16,12,9,6,4,2,1,17,30,40,46,49,48,44,36,25 %N A368607 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 A368607 Row n consists of 2n-1 positive integers. %e A368607 First six rows: %e A368607 1 %e A368607 3 2 1 %e A368607 5 6 4 2 1 %e A368607 7 10 10 6 4 2 1 %e A368607 9 14 16 14 9 6 4 2 1 %e A368607 11 18 22 22 19 12 9 6 4 2 1 %e A368607 For n=3, there are 6 triples (x,y,z) having x != y and y < z: %e A368607 123: |x-y| + |y-z| = 2 %e A368607 212: |x-y| + |y-z| = 2 %e A368607 213: |x-y| + |y-z| = 3 %e A368607 312: |x-y| + |y-z| = 3 %e A368607 313: |x-y| + |y-z| = 4 %e A368607 323: |x-y| + |y-z| = 2 %e A368607 so row 2 of the array is (3,2,1), representing three 2s, two 3s, and one 4. %t A368607 t1[n_] := t1[n] = Tuples[Range[n], 3]; %t A368607 t[n_] := t[n] = Select[t1[n], #[[1]] != #[[2]] < #[[3]] &]; %t A368607 a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &]; %t A368607 u = Table[Length[a[n, k]], {n, 2, 15}, {k, 2, 2 n - 2}]; %t A368607 v = Flatten[u] (* sequence *) %t A368607 Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 2, 2 n - 2}]] (* array *) %Y A368607 Cf. A005408 (column 1), A002411 (row sums), A002620 (limiting reversed row), A368434, A368437, A368515, A368516, A368517, A368518, A368519, A368520, A368521, A368522, A368604, A368605, A368606, A368609. %K A368607 nonn,tabf %O A368607 1,2 %A A368607 _Clark Kimberling_, Jan 25 2024