login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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.
0
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,1
COMMENTS
If p and q are twin primes and x is their average, then among all pairs of primes (k, m) such that |x - k| = |x - m|, it is observed that p and q are at the smallest distance from x, which is 1. Our interest lies in finding the pair (m, k) such that the distance to x is maximum and then determining |k - m|.
EXAMPLE
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.
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Gonzalo Martínez, Aug 13 2024
STATUS
approved