OFFSET
1,1
COMMENTS
The primes are taken "with multiplicity".
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000 (updated by Robert Israel, May 25 2022)
EXAMPLE
2 is a term, since 2 + 0 + 3 = 5 is a prime.
13 is a term since 13 + (2+2+3) + (2+7) = 29 is prime, i.e. the prime factors are added with multiplicity.
151 is prime, 150 = 2*3*5*5, 152 = 2*2*2*19. 151 + 2+3+5+5 + 2+2+2+19 = 191 is prime, hence 151 is a term.
MAPLE
spf:= proc(n) local t; add(t[1]*t[2], t = ifactors(n)[2]) end proc:
filter:= proc(p) isprime(p) and isprime(p+spf(p-1)+spf(p+1)) end proc:
select(filter, [$2..10000]); # Robert Israel, May 25 2022
MATHEMATICA
pspfQ[n_] := PrimeQ[n + Total[Flatten[Table[#[[1]], {#[[2]]}] & /@ Flatten[FactorInteger[n + {1, -1}], 1] ] ] ]; {2}~Join~Select[Prime[Range[400]], pspfQ] (* Harvey P. Dale, Jan 08 2015, corrected by Michael De Vlieger, May 25 2022 *)
PROG
(Magma) [ p: p in PrimesInInterval(3, 2100) | IsPrime(&+[ &+[ k[1]*k[2]: k in Factorization(n)]: n in [p-1..p+1] ] ) ]; /* Klaus Brockhaus, Apr 06 2007 */
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot, Mar 28 2007
EXTENSIONS
Edited and extended by Klaus Brockhaus, Apr 06 2007
Edited by N. J. A. Sloane, May 25 2022
STATUS
approved