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 A368515 #7 Jan 20 2024 09:46:05 %S A368515 2,2,4,8,4,2,6,14,14,8,4,2,8,20,24,22,12,8,4,2,10,26,34,36,30,18,12,8, %T A368515 4,2,12,32,44,50,48,40,24,18,12,8,4,2,14,38,54,64,66,62,50,32,24,18, %U A368515 12,8,4,2,16,44,64,78,84,84,76,62,40,32,24,18,12,8,4 %N A368515 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 A368515 Row n consists of 2n even positive integers. %e A368515 First six rows: %e A368515 2 2 %e A368515 4 8 4 2 %e A368515 6 14 14 8 4 2 %e A368515 8 20 24 22 12 8 4 2 %e A368515 10 26 34 36 30 18 12 8 4 2 %e A368515 12 32 44 50 48 40 24 18 12 8 4 2 %e A368515 For n=2, there are 4 triples (x,y,z) having x != y: %e A368515 121: |x-y| + |y-z| = 2 %e A368515 122: |x-y| + |y-z| = 1 %e A368515 211: |x-y| + |y-z| = 1 %e A368515 212: |x-y| + |y-z| = 2, %e A368515 so that row 2 of the array is (2,2), representing two 1s and two 2s. %t A368515 t1[n_] := t1[n] = Tuples[Range[n], 3]; %t A368515 t[n_] := t[n] = Select[t1[n], #[[1]] != #[[2]] &]; %t A368515 a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &]; %t A368515 u = Table[Length[a[n, k]], {n, 2, 15}, {k, 1, 2 n - 2}]; %t A368515 v = Flatten[u]; (* sequence *) %t A368515 Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 1, 2 n - 2}]] (* array *) %Y A368515 Cf. A045991 (row sums), A007590 (limiting reverse row), A368434, A368437, A368516, A368517, A368518, A368519, A368520, A368521, A368522. %K A368515 nonn,tabf %O A368515 1,1 %A A368515 _Clark Kimberling_, Dec 31 2023