proposed
approved
proposed
approved
editing
proposed
h[l_] := With[{n = Length[l]}, Total[l]!/Product[Product[1 + l[[i]] - j + Sum[If[l[[k]] >= j, 1, 0], {k, i + 1, n}], {j, 1, l[[i]]}], {i, 1, n}]];
Total[l]!/
Product[Product[
1 + l[[i]] - j + Sum[If[l[[k]] >= j, 1, 0], {k, i + 1, n}], {j,
1, l[[i]]}], {i, 1, n}]];
g[n_, i_, l_] :=
g[n_, i_, l_] := If[n == 0 || i == 1, h[Join[l, Array[1 &, n]]], If[i < 1, 0, Flatten@ Table[g[n - i*j, i - 1, Join[l, Array[i &, j]]], {j, 0, n/i}]]];
If[i < 1, 0,
Flatten@Table[
g[n - i*j, i - 1, Join[l, Array[i &, j]]], {j, 0, n/i}]]];
h[l_] := With[{n = Length[l]},
Total[l]!/
Product[Product[
1 + l[[i]] - j + Sum[If[l[[k]] >= j, 1, 0], {k, i + 1, n}], {j,
1, l[[i]]}], {i, 1, n}]];
g[n_, i_, l_] :=
If[n == 0 || i == 1, h[Join[l, Array[1 &, n]]],
If[i < 1, 0,
Flatten@Table[
g[n - i*j, i - 1, Join[l, Array[i &, j]]], {j, 0, n/i}]]];
a[n_] := a[n] = If[n == 1, 1, Select[g[n, n, {}], OddQ] // Total];
Table[Print[n, " ", a[n]];
a[n], {n, 1, 50}] (* Jean-François Alcover, Sep 23 2024, after Alois P. Heinz in A060240 *)
approved
editing
proposed
approved
editing
proposed
editing
proposed
.... res = 0
.... for P in Partitions(n) :
........ deg = P.dimension()
........ if is_odd(deg) : res += deg
.... return res
end; # Eric M. Schmidt, Apr 28 2013
approved
editing
proposed
approved