A358573 a(n) = smallest prime p such that q, r and s are all prime, where q = p + 2*(2*n + 1), r = (p - 2*n - 1)/2, and s = (q + 2*n + 1)/2.
11, 13, 19, 17, 19, 229, 47, 29, 163, 29, 31, 37, 47, 53, 1231, 41, 43, 61, 83, 61, 439, 1217, 59, 73, 59, 61, 67, 89, 83, 541, 71, 73, 103, 593, 271, 349, 83, 89, 103, 461, 239, 97, 107, 97, 211, 149, 107, 229, 263, 181, 499, 317, 139, 1453, 131, 809, 127, 137, 163
Offset: 0
Keywords
Examples
229 is the lesser prime in the pair (229, 251) with difference 2*(2*5+1) = 22, and the couple (229-22/2)/2 = 109 and (251+22/2)/2 = 131 forms another prime pair with distance 22, and there is no prime lower than 229 with this property. Hence a(5) = 229.
Programs
-
Mathematica
a[n_] := Module[{p=2, q, r, s}, While[!AllTrue[{(q = p + 2*(2*n + 1)), (r = (p - 2*n - 1)/2), (s = (q + 2*n + 1)/2)}, #>0 && PrimeQ[#] &], p = NextPrime[p]]; p]; Array[a, 60, 0] (* Amiram Eldar, Nov 23 2022 *)
-
PARI
a(n) = my(p=2, q); while(!isprime(q = p + 2*(2*n + 1)) || !isprime((p - 2*n - 1)/2) || !isprime((q + 2*n + 1)/2), p=nextprime(p+1)); p; \\ Michel Marcus, Nov 23 2022
Comments