OFFSET
1,1
COMMENTS
EXAMPLE
a(1) = 7 since 7, 11, 13 have differences of 4 and 2;
a(2) = 31 since 31, 37, 41 have differences of 6 and 4;
a(3) = 359 since 359, 367, 373 have differences of 8 and 6;
MATHEMATICA
p = 2; q = 3; r = 5; t[_] := 0; While[p < 53000000, If[r + p + 2 == 2 q && t[(r - q)/2] == 0, t[(r - q)/2] = p]; {p, q, r} = {q, r, NextPrime[r]}]; t /@ Range@36
PROG
(PARI) upto(lim)={my(L=List([0]), d=0, q=5); forprime(p=7, lim, if(p-q==2*d, while(#L<=d, listput(L, 0)); if(!L[d], L[d]=q-2-2*d)); d=(p-q)/2-1; q=p); my(k=1); while(L[k], k++); Vec(L[1..k-1])} \\ Andrew Howroyd, Feb 27 2026
(Python)
from gmpy2 import next_prime
from itertools import islice
def agen(): # generator of terms
adict, n = {None: None}, 1
p, q, r = 2, 3, 5
while True:
p, q, r = q, r, next_prime(r)
v = (r-q)//2 if q-p == r-q + 2 else None
if v not in adict:
adict[v] = int(p)
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 34))) # Michael S. Branicky, Feb 28 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Feb 27 2026
STATUS
approved
