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 A200068 #31 Apr 25 2022 13:25:58 %S A200068 1,1,2,3,1,5,1,1,1,7,3,1,3,0,0,2,11,4,2,4,3,1,3,0,1,1,1,0,1,15,8,3,8, %T A200068 3,3,7,1,2,3,1,3,2,0,1,2,0,0,1,0,1,22,11,7,12,4,5,13,5,4,7,4,4,5,0,3, %U A200068 6,2,1,2,1,2,3,0,0,2,1,0,0,0,0,2 %N A200068 Irregular triangle read by rows: T(n,k), n>=0, 0<=k<=A200067(n), is number of compositions of n such that the sum of weighted inversions equals k and weights are products of absolute differences and distances between the element pairs which are not in sorted order. %H A200068 Alois P. Heinz, <a href="/A200068/b200068.txt">Rows n = 0..28, flattened</a> %e A200068 The compositions of n = 4 have weighted inversions 0: [4], [2,2], [1,3], [1,1,2], [1,1,1,1]; 1: [1,2,1]; 2: [3,1]; 3: [2,1,1]; => row 4 = [5,1,1,1]. %e A200068 Irregular triangle begins: %e A200068 1; %e A200068 1; %e A200068 2; %e A200068 3, 1; %e A200068 5, 1, 1, 1; %e A200068 7, 3, 1, 3, 0, 0, 2; %e A200068 11, 4, 2, 4, 3, 1, 3, 0, 1, 1, 1, 0, 1; %e A200068 15, 8, 3, 8, 3, 3, 7, 1, 2, 3, 1, 3, 2, 0, 1, 2, 0, 0, 1, 0, 1; %e A200068 ... %p A200068 T:= proc(n) option remember; local mx, b, p; %p A200068 b:=proc(m, i, l) local h; %p A200068 if m=0 then p(i):= p(i)+1; if i>mx then mx:=i fi %p A200068 else seq(b(m-h, i +add(`if`(l[j]<h, j*(h-l[j]), 0), %p A200068 j=1..nops(l)), [h, l[]]), h=1..m) fi %p A200068 end; %p A200068 mx:=0; %p A200068 p:= proc() 0 end; forget(p); %p A200068 b(n, 0, []); seq(p(i), i=0..mx) %p A200068 end: %p A200068 seq(T(n), n=0..10); %t A200068 T[n_] := T[n] = Module[{mx, b, p}, %t A200068 b[m_, i_, l_] := Module[{h}, %t A200068 If[m == 0, p[i] = p[i]+1; If[i > mx, mx = i], %t A200068 Table[b[m-h, i + Sum[If[l[[j]] < h, j*(h - l[[j]]), 0], %t A200068 {j, 1, Length[l]}], Join[{h}, l]], {h, 1, m}]]]; %t A200068 mx = 0; %t A200068 p[_] = 0; %t A200068 b[n, 0, {}]; Table[p[i], {i, 0, mx}]]; %t A200068 Table[T[n], {n, 0, 10}] // Flatten (* _Jean-François Alcover_, Apr 25 2022, after _Alois P. Heinz_ *) %Y A200068 Cf. A000041 (column k=0), A024786(n-1) (column k=1), A011782 (row sums), A200067 (row lengths -1), A189074. %K A200068 nonn,tabf,look %O A200068 0,3 %A A200068 _Alois P. Heinz_, Nov 13 2011