[go: up one dir, main page]

login
A280266
Primes such that the previous prime plus the next prime plus 1 is also prime.
2
5, 7, 13, 19, 31, 37, 43, 47, 53, 61, 73, 79, 89, 97, 137, 151, 167, 173, 193, 199, 223, 229, 241, 251, 271, 349, 353, 367, 379, 383, 409, 439, 457, 463, 487, 503, 521, 523, 587, 593, 619, 643, 647, 653, 727, 787, 797, 809, 829, 853, 859, 937
OFFSET
1,1
LINKS
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