OFFSET
1,6
COMMENTS
If n is prime, a(n) = 1.
If n is a prime power other than 4, a(n) = 0.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jun 13 2021
STATUS
approved