A381373 Sum over all partitions of [n] of n^j for a partition with j inversions.
1, 1, 2, 7, 72, 3276, 915848, 2011878835, 42723411900032, 10608257527069388539, 35808039364308986083608352, 1828963737334508176477805993389490, 1618534282345584818909121118371843799592960, 28472613161534902071627567919297331348486838233018341
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..41
- Wikipedia, Inversion
- Wikipedia, Partition of a set
Programs
-
Maple
b:= proc(o, u, t, k) option remember; `if`(u+o=0, 1, `if`(t>0, b(u+o, 0$2, k), 0)+add(k^(u+j-1)* b(o-j, u+j-1, min(2, t+1), k), j=`if`(t=0, 1, 1..o))) end: a:= n-> b(n, 0$2, n): seq(a(n), n=0..15);
-
Mathematica
b[o_, u_, t_, k_] := b[o, u, t, k] = If[u + o == 0, 1, If[t > 0, b[u + o, 0, 0, k], 0] + Sum[k^(u + j - 1)* b[o - j, u + j - 1, Min[2, t + 1], k], {j, If[t == 0, {1}, Range[o]]}]]; a[n_] := b[n, 0, 0, n]; Table[a[n], {n, 0, 15}] (* Jean-François Alcover, Mar 15 2025, after Alois P. Heinz *)