OFFSET
0,5
COMMENTS
Each set partition is written as a sequence of blocks, ordered by the smallest elements in the blocks.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..573
Wikipedia, Inversion (discrete mathematics)
Wikipedia, Partition of a set
FORMULA
a(n) = Sum_{k>0} k * A125810(n,k).
EXAMPLE
a(3) = 1: one inversion in 13|2.
a(4) = 10: one inversion in each of 124|3, 13|24, 13|2|4, 1|24|3, and two inversions in each of 134|2, 14|23, 14|2|3.
MAPLE
b:= proc(n, t) option remember; `if`(n=0, [1, 0], add((p-> p+
[0, p[1]*(j*t/2)])(b(n-j, t+j-1))*binomial(n-1, j-1), j=1..n))
end:
a:= n-> b(n, 0)[2]:
seq(a(n), n=0..23); # Alois P. Heinz, Feb 20 2025
MATHEMATICA
b[n_, t_] := b[n, t] = If[n == 0, {1, 0}, Sum[Function[p, p+{0, p[[1]]*(j*t/2)}][b[n-j, t+j-1]]*Binomial[n-1, j-1], {j, 1, n}]];
a[n_] := b[n, 0][[2]];
Table[a[n], {n, 0, 23}] (* Jean-François Alcover, May 21 2025, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 03 2016
STATUS
approved
