OFFSET
1,1
COMMENTS
If p is a term then p+2 is a prime power with an even exponent (A056798). - Amiram Eldar, Aug 01 2024
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
2 is a term since it is a prime and sigma(2+2) = 7 is a prime.
7 is a term since it is a prime and sigma(7+2) = 13 is a prime.
23 is a term since it is a prime and sigma(23+2) = 31 is a prime.
727 is a term since it is a prime and sigma(727+2) = 1093 is a prime.
MAPLE
with(numtheory): A171130:=n->`if`(isprime(n) and isprime(sigma(n+2)), n, NULL): seq(A171130(n), n=1..10^5); # Wesley Ivan Hurt, Sep 30 2014
MATHEMATICA
f[n_]:=Plus@@Divisors[n]; lst={}; Do[p=Prime[n]; If[PrimeQ[f[p+2]], AppendTo[lst, p]], {n, 10!}]; lst
Select[Prime[Range[700000]], PrimeQ[DivisorSigma[1, #+2]]&] (* Harvey P. Dale, Jun 23 2011 *)
PROG
(PARI) lista(nn) = forprime(p=2, nn, if (isprime(sigma(p+2)), print1(p, ", "))); \\ Michel Marcus, Sep 30 2014
(PARI) lista(kmax) = {my(p); for(k = 1, kmax, if(isprime(k) || isprimepower(k), p = k^2-2; if(isprime(p) && isprime(sigma(p+2)), print1(p, ", ")))); } \\ Amiram Eldar, Aug 01 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Dec 04 2009
EXTENSIONS
More terms from Michel Marcus, Sep 30 2014
STATUS
approved