login
A345300
a(n) is the number of distinct primes of the form n + A - B where A and B are sums of subsets of the prime factors of n.
2
0, 1, 1, 1, 1, 4, 1, 0, 0, 5, 1, 4, 1, 4, 4, 0, 1, 4, 1, 3, 3, 3, 1, 3, 0, 4, 0, 3, 1, 4, 1, 0, 3, 3, 3, 3, 1, 3, 2, 3, 1, 4, 1, 2, 4, 3, 1, 3, 0, 3, 3, 3, 1, 2, 2, 2, 3, 3, 1, 4, 1, 2, 4, 0, 3, 5, 1, 2, 2, 4, 1, 3, 1, 3, 3, 2, 2, 5, 1, 2, 0, 2, 1, 3, 3, 4, 2, 3, 1, 3, 2, 3, 2, 2, 2, 2, 1, 3, 2
OFFSET
1,6
COMMENTS
If n is prime, a(n) = 1.
If n is a prime power other than 4, a(n) = 0.
LINKS
EXAMPLE
a(6) = 4 because there are four such primes: 3 = 6-3, 5 = 6+2-3, 7 = 6+3-2, and 11=6+2+3.
MAPLE
f:= proc(n) local S, p;
S:= {n};
for p in numtheory:-factorset(n) do
S:= S union map(`+`, S, p) union map(`-`, S, p)
od:
nops(select(isprime, S))
end proc:
map(f, [$1..1000]);
CROSSREFS
Cf. A345316.
Sequence in context: A297785 A126217 A334702 * A085992 A117411 A161739
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jun 13 2021
STATUS
approved