A354691 Numbers k with the property that 4*p+q and 4*q+p are primes, where p = prime(k) and q = prime(k+1).
2, 23, 74, 86, 91, 96, 97, 99, 100, 105, 133, 174, 280, 305, 357, 372, 504, 554, 562, 565, 660, 668, 686, 716, 733, 741, 789, 796, 859, 885, 909, 925, 993, 1021, 1103, 1131, 1136, 1144, 1191, 1215, 1234, 1248, 1285, 1326, 1334, 1414, 1503, 1559, 1577, 1590, 1607, 1656, 1738, 1751, 1822, 1847, 1894, 1929, 2088, 2090
Offset: 1
Keywords
Programs
-
Mathematica
sp = {}; sq = {}; Do[p = Prime[k]; q = NextPrime[p]; If[PrimeQ[4*p + q], AppendTo[sp, k]]; If[PrimeQ[4*q + p], AppendTo[sq, k]], {k, 10000}]; Intersection[sp, sq]
-
Python
from itertools import islice from sympy import isprime, nextprime def agen(): # generator of terms k, p, q = 1, 2, 3 while True: if isprime(4*p+q) and isprime(4*q+p): yield k k, p, q = k+1, q, nextprime(q) print(list(islice(agen(), 60))) # Michael S. Branicky, Jun 03 2022