OFFSET
1,4
COMMENTS
An integer n is a positive subset-sum of a multiset y if there exists a nonempty submultiset of y with sum n.
One less than the number of distinct values obtained when A001414 is applied to all divisors of n. - Antti Karttunen, Jun 13 2018
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
EXAMPLE
The a(12) = 5 positive subset-sums of {2, 2, 3} are 2, 3, 4, 5, and 7.
MATHEMATICA
Table[Length[Union[Total/@Rest[Subsets[Join@@Cases[FactorInteger[n], {p_, k_}:>Table[p, {k}]]]]]], {n, 100}]
PROG
(PARI)
up_to = 65537;
v001414 = vector(up_to, n, A001414(n));
A305611(n) = { my(m=Map(), s, k=0); fordiv(n, d, if(!mapisdefined(m, s = v001414[d]), mapput(m, s, s); k++)); (k-1); }; \\ Antti Karttunen, Jun 13 2018
(Python)
from sympy import factorint
from sympy.utilities.iterables import multiset_combinations
def A305611(n):
fs = factorint(n)
return len(set(sum(d) for i in range(1, sum(fs.values())+1) for d in multiset_combinations(fs, i))) # Chai Wah Wu, Aug 23 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 06 2018
STATUS
approved