OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..400
Wikipedia, Partition of a set
FORMULA
a(n) mod 2 = A131719(n).
EXAMPLE
a(3) = 13 = 1*3 + 3*(1+2) + 1: 123, 1|23, 13|2, 12|3, 1|2|3.
MAPLE
b:= proc(n, i, c) option remember; `if`(n=0, c,
`if`(i<1, 0, add(b(n-j*i, i-1, c+i*signum(j))*
combinat[multinomial](n, n-i*j, i$j)/j!, j=0..n/i)))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..30);
MATHEMATICA
multinomial[n_, k_List] := n!/Times @@ (k!);
b[n_, i_, c_] := b[n, i, c] = If[n == 0, c,
If[i < 1, 0, Sum[b[n - j*i, i - 1, c + i*Sign[j]]*
multinomial[n, Join[{n - i*j}, Table[i, {j}]]]/j!, {j, 0, n/i}]]];
a[n_] := b[n, n, 0];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jan 11 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jan 06 2022
STATUS
approved