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 A368520 #4 Jan 25 2024 08:07:53 %S A368520 1,2,2,2,3,4,7,2,2,4,6,12,8,6,2,2,5,8,17,14,15,6,6,2,2,6,10,22,20,24, %T A368520 16,12,6,6,2,2,7,12,27,26,33,26,25,12,12,6,6,2,2,8,14,32,32,42,36,38, %U A368520 26,20,12,12,6,6,2,2,9,16,37,38,51,46,51,40,37,20,20 %N A368520 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 <= z. %C A368520 Row n consists of 2n-1 positive integers. %e A368520 First seven rows: %e A368520 1 %e A368520 2 2 2 %e A368520 3 4 7 2 2 %e A368520 4 6 12 8 6 2 2 %e A368520 5 8 17 14 15 6 6 2 2 %e A368520 6 10 22 20 24 16 12 6 6 2 2 %e A368520 7 12 27 26 33 26 25 12 12 6 6 2 2 %e A368520 For n=2, there are 6 triples (x,y,z) having x <= z: %e A368520 111: |x-y| + |y-z| = 0 %e A368520 112: |x-y| + |y-z| = 1 %e A368520 121: |x-y| + |y-z| = 2 %e A368520 122: |x-y| + |y-z| = 1 %e A368520 212: |x-y| + |y-z| = 2 %e A368520 222: |x-y| + |y-z| = 0 %e A368520 so that row 1 of the array is (2,2,2), representing two 0s, two 1s, and two 2s. %t A368520 t1[n_] := t1[n] = Tuples[Range[n], 3]; %t A368520 t[n_] := t[n] = Select[t1[n], #[[1]] <= #[[3]] &]; %t A368520 a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &]; %t A368520 u = Table[Length[a[n, k]], {n, 1, 15}, {k, 0, 2 n - 2}]; %t A368520 v = Flatten[u] (* sequence *) %t A368520 Column[Table[Length[a[n, k]], {n, 1, 15}, {k, 0, 2 n - 2}]] (* array *) %Y A368520 Cf. A002411 (row sums), A110660 (limiting reverse row), A368434, A368437, A368515, A368516, A368517, A368518, A368519, A368521, A368522. %K A368520 nonn,tabf %O A368520 1,2 %A A368520 _Clark Kimberling_, Jan 22 2024