A355273 Primes p for which p + q is a multiple of 4, where q is the previous prime if p == 2 (mod 3) or the next prime otherwise.
3, 5, 29, 31, 53, 59, 61, 73, 89, 137, 139, 149, 151, 157, 173, 179, 181, 191, 239, 241, 251, 257, 263, 269, 271, 283, 293, 331, 337, 347, 359, 367, 373, 389, 409, 419, 421, 431, 433, 449, 509, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 631
Offset: 1
Keywords
Programs
-
PARI
select( is(p)=if(p%3==2, precprime(p-1)+p, nextprime(p+1)+p)%4==0, primes(149))
-
Python
from sympy import nextprime from itertools import islice def agen(): p, q = 2, [3, 1] while True: if (p + q[int(p%3 == 2)])%4 == 0: yield p p, q = q[0], [nextprime(q[0]), p] print(list(islice(agen(), 54))) # Michael S. Branicky, Jun 26 2022
Comments