OFFSET
1,21
COMMENTS
An integer partition is knapsack if every distinct submultiset has a different sum.
EXAMPLE
The partition (10,8,6,6) is counted under a(30) because (10,10,8,6,6), (10,8,8,6,6), and (10,8,6,6,6) are not knapsack.
MATHEMATICA
sums[ptn_]:=sums[ptn]=If[Length[ptn]==1, ptn, Union@@(Join[sums[#], sums[#]+Total[ptn]-Total[#]]&/@Union[Table[Delete[ptn, i], {i, Length[ptn]}]])];
ksQ[y_]:=Length[sums[Sort[y]]]==Times@@(Length/@Split[Sort[y]]+1)-1;
maxks[n_]:=Select[IntegerPartitions[n], ksQ[#]&&Select[Table[Sort[Append[#, i]], {i, Union[#]}], ksQ]=={}&];
Table[Length[maxks[n]], {n, 30}]
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Gus Wiseman, Jun 03 2019
STATUS
approved