OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
5 is in the sequence because 3 + 7 + 1 = 11, which is prime.
7 is in the sequence because 5 + 11 + 1 = 17, which is prime.
11 is not in the sequence because 7 + 13 + 1 = 21, which is not prime.
MATHEMATICA
fQ[p_] := PrimeQ[ NextPrime[p, -1] + NextPrime[ p] +1]; Select[ Prime@ Range[2, 170], fQ] (* Robert G. Wilson v, Dec 30 2016 *)
Select[Partition[Prime[Range[200]], 3, 1], PrimeQ[#[[1]]+#[[3]]+1]&][[All, 2]] (* Harvey P. Dale, Dec 16 2018 *)
PROG
(Sage)
max_next_p = 1000
seq = []
prev_p = nth_prime(1)
p = nth_prime(2)
for next_p in primes(nth_prime(3), max_next_p):
if is_prime(prev_p + next_p + 1):
seq.append(p)
prev_p = p
p = next_p
print(seq)
(PARI) isok(n) = isprime(n) && isprime(precprime(n-1) + nextprime(n+1) + 1); \\ Michel Marcus, Dec 30 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert C. Lyons, Dec 30 2016
STATUS
approved