login
A299702
Heinz numbers of knapsack partitions.
110
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 64, 65, 66, 67, 68, 69, 71, 73, 74, 75, 76, 77, 78
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
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[#]]]&]
KEYWORD
nonn,changed
AUTHOR
Gus Wiseman, Feb 17 2018
STATUS
approved