login
A393799
The least prime p of three consecutive primes p,q,r such that q - p = 2n + 2 and r - q = 2n.
0
7, 31, 359, 691, 619, 7043, 1831, 4603, 40193, 43669, 29077, 16007, 114913, 165103, 202409, 334897, 370723, 981983, 321469, 250501, 1256063, 1980991, 3137263, 2890763, 3861607, 1199203, 1683113, 2280709, 10016563, 4221047, 21570253, 2401741, 14527553, 6750259, 43104631, 52744103
OFFSET
1,1
COMMENTS
The sequence is not monotonic.
These primes are not balanced (A006562). But that does not preclude A096693(a(n)) from not being 0. Case in point is A096693(a(3)) = 1.
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