OFFSET
1,2
COMMENTS
An integer partition is knapsack if every distinct submultiset has a different sum. The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
filter:= proc(n) local F, t, S, i, r;
F:= map(t -> [numtheory:-pi(t[1]), t[2]], ifactors(n)[2]);
S:= {0}: r:= 1;
for t in F do
S:= map(s -> seq(s + i*t[1], i=0..t[2]), S);
r:= r*(t[2]+1);
if nops(S) <> r then return false fi
od;
true
end proc:
select(filter, [$1..100]); # Robert Israel, Oct 30 2024
MATHEMATICA
primeMS[n_]:=If[n===1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
Select[Range[100], UnsameQ@@Plus@@@Union[Rest@Subsets[primeMS[#]]]&]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Feb 17 2018
STATUS
approved