%I #33 Sep 08 2022 08:45:29
%S 2,13,47,71,101,151,193,239,241,293,331,337,359,383,397,401,421,463,
%T 487,557,577,709,773,797,821,929,1019,1031,1069,1093,1103,1181,1217,
%U 1249,1327,1367,1423,1499,1571,1759,1787,1789,1831,1871,1877,1913,1933,2053
%N Primes p such that p + (sum of the prime factors of p-1) + (sum of prime factors of p+1) is prime.
%C The primes are taken "with multiplicity".
%H Harvey P. Dale, <a href="/A127305/b127305.txt">Table of n, a(n) for n = 1..1000</a> (updated by _Robert Israel_, May 25 2022)
%e 2 is a term, since 2 + 0 + 3 = 5 is a prime.
%e 13 is a term since 13 + (2+2+3) + (2+7) = 29 is prime, i.e. the prime factors are added with multiplicity.
%e 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.
%p spf:= proc(n) local t; add(t[1]*t[2], t = ifactors(n)[2]) end proc:
%p filter:= proc(p) isprime(p) and isprime(p+spf(p-1)+spf(p+1)) end proc:
%p select(filter, [$2..10000]); # _Robert Israel_, May 25 2022
%t 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 *)
%o (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 */
%Y Cf. A210934, A210936.
%K nonn
%O 1,1
%A _J. M. Bergot_, Mar 28 2007
%E Edited and extended by _Klaus Brockhaus_, Apr 06 2007
%E Edited by _N. J. A. Sloane_, May 25 2022