A375358 a(n) is the greatest difference between m and k, with m, k both prime such that k + m = p + q, where (p, q) is the n-th twin prime pair.
2, 2, 14, 26, 46, 74, 106, 134, 194, 206, 266, 286, 346, 374, 382, 442, 454, 506, 550, 614, 686, 818, 854, 914, 1034, 1118, 1186, 1226, 1274, 1294, 1606, 1630, 1618, 1702, 1754, 2018, 2042, 2078, 2102, 2174, 2290, 2434, 2546, 2534, 2582, 2626, 2846, 2890, 2950
Offset: 1
Keywords
Examples
Since the 3rd pair of twin primes is (11, 13), whose sum is 24, and the other pairs of primes that sum to 24 are (5, 19) and (7, 17), the greatest difference is 19 - 5 = 14. Therefore, a(3) = 14.
Programs
-
Python
from itertools import islice from sympy import isprime, nextprime, primerange def agen(): # generator of terms p, q = 2, 3 while True: if q - p == 2: s = p + q yield max(m-k for k in primerange(2, s//2+1) if isprime(m:=s-k)) p, q = q, nextprime(q) print(list(islice(agen(), 80))) # Michael S. Branicky, Aug 13 2024
Comments