OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
p=5; prime(5) + 5 + 1 = 17 and prime(5) - 5 - 1 = 5, both prime so 5 is a member, and since the same does not hold for primes 2 and 3, a(1)=5.
MAPLE
N:=5000:
for X from 1 to N do
A:=ithprime(X);
P:=A+X+1;
Q:=A-X-1;
if isprime(X) and isprime(P) and isprime(Q) then print(X);
end if:
end do:
MATHEMATICA
Select[Prime[Range[2 10^3]], And@@PrimeQ[{Prime[#] + # + 1, Prime[#] - # - 1}] &] (* Vincenzo Librandi, Aug 18 2018 *)
PROG
(Magma) [n: n in [1..2*10^4] | IsPrime(n) and IsPrime (NthPrime(n)+n+1) and IsPrime (NthPrime(n)-n-1)]; // Vincenzo Librandi, Aug 18 2018
(PARI) isok(p) = isprime(p) && isprime(prime(p) + p + 1) && isprime(prime(p) - p - 1); \\ Michel Marcus, Aug 18 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David James Sycamore, Aug 16 2018
EXTENSIONS
More terms from Vincenzo Librandi, Aug 18 2018
STATUS
approved