OFFSET
1,1
COMMENTS
p, q, 2*p+q, 2*p-q, p+2*q and p-2*q are all prime if and only if q = 3 and p is in this sequence.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 53 is a term because 53, 53+6 = 59, 53-6 = 47, 2*53 + 3 = 109 and 2*53 - 3 = 103 are all prime.
MAPLE
filter:= proc(p) andmap(isprime, [p, p+6, p-6, 2*p+3, 2*p-3]) end proc:
select(filter, [seq(i, i=3..200000, 2)]);
MATHEMATICA
Select[Prime[Range[10^4]], AllTrue[{# - 6, # + 6, 2*# - 3, 2*# + 3}, PrimeQ] &] (* Amiram Eldar, Jul 25 2022 *)
PROG
(Python)
from sympy import isprime
def ok(p): return all(isprime(k) for k in [p, p+6, p-6, 2*p+3, 2*p-3])
print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Jul 25 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jul 25 2022
STATUS
approved