OFFSET
1,4
COMMENTS
A positive special sum of y is a number n > 0 such that exactly one submultiset of y sums to n. The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
EXAMPLE
The a(36) = 4 special sums are 1, 3, 5, 6, corresponding to the submultisets (1), (21), (221), (2211), with Heinz numbers 2, 6, 18, 36.
MATHEMATICA
primeMS[n_]:=If[n===1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
uqsubs[y_]:=Join@@Select[GatherBy[Union[Rest[Subsets[y]]], Total], Length[#]===1&];
Table[Length[uqsubs[primeMS[n]]], {n, 100}]
PROG
(PARI)
up_to = 65537;
A056239(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i, 2] * primepi(f[i, 1]))); }
v056239 = vector(up_to, n, A056239(n));
A304795(n) = { my(m=Map(), s, k=0, c); fordiv(n, d, if(!mapisdefined(m, s = v056239[d], &c), mapput(m, s, 1), mapput(m, s, c+1))); sumdiv(n, d, (1==mapget(m, v056239[d])))-1; }; \\ Antti Karttunen, Jul 02 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 18 2018
EXTENSIONS
More terms from Antti Karttunen, Jul 02 2018
STATUS
approved