OFFSET
1,1
COMMENTS
These are the "lonely twin primes" in terms of the distance between twin prime pairs, while the lonely twin primes defined in A069453 are those without adjacent twin primes.
PROG
(Python)
from sympy import isprime, nextprime
def nexttwin(x):
p1 = nextprime(x); t1 = p1 + 2
while isprime(t1) == 0: p1 = nextprime(t1); t1 = p1 + 2
return p1+1
print(3, end = ', '); L = [4]
while L[0] < 6870:
t0 = L[-1]; t1 = nexttwin(t0); g0 = t1 - t0; M = [t1]; t = nexttwin(t1); g1 = t - t1
while g1 < g0 and t - t1 <= g1: M.append(t); t1 = t; t = nexttwin(t)
if len(M) == 1: print(M[0]-1, M[0]+1, sep = ', ', end = ', ')
L = M
CROSSREFS
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Oct 14 2025
STATUS
approved
