login
A368640
a(0) = 2; for n > 0, a(n) is the smallest prime that differs from the next prime by 2n and is not part of a run of 3 or more consecutive primes in arithmetic progression, or -1 if no such prime exists.
0
2, 11, 7, 23, 89, 139, 467, 113, 1831, 523, 887, 1129, 1669, 2477, 2971, 4297, 5591, 1327, 9551, 30593, 19333, 16141, 15683, 81463, 28229, 31907, 19609, 35617, 82073, 44293, 43331, 34061, 89689, 162143, 134513, 173359, 31397, 404597, 212701, 188029, 542603, 265621
OFFSET
0,1
COMMENTS
Equivalently, a(0) = 2, and for n > 0, a(n) is the smallest prime p such that NextPrime(p) - p = 2n but neither p - PreviousPrime(p) nor NextPrime(NextPrime(p)) - NextPrime(p) is equal to 2n, or -1 if no such prime p exists.
Stated yet another way: define an array A such that A(i,j) is the smallest prime that is at the start of a run of exactly i consecutive prime gaps of size exactly j, or -1 if no such prime exists; then a(0) = 2 and, for n > 0, a(n) = A(1,2n).
Conjecture: a(n) is never -1.
FORMULA
a(n) >= A000230(n).
EXAMPLE
a(1) is the smallest prime that differs from the next prime by 2 and is not part of a run of 3 or more consecutive primes in arithmetic progression. (Thus a(1) is the smallest prime p that is the lesser of a twin prime pair (p,q) (cf. A001359) where neither p nor q is part of another twin prime pair.) The primes 3, 5, 7 are in arithmetic progression with difference 2, so none of those primes is a(1); the smallest prime that meets the requirements is 11, so a(1) = 11.
a(6) is the smallest prime that differs from the next prime by 12 and is not part of a run of 3 or more consecutive primes in arithmetic progression. Primes that differ from the next prime by 12 are 199, 211, 467, 509, 619, ... (cf. A031930), but 199 and 211 are part of a run of three consecutive primes in arithmetic progression (199, 211, and 223). Thus, since PreviousPrime(467) != 455 and NextPrime(479) != 491, 467 is not in a run of three or more consecutive primes in arithmetic progression, so a(6) = 467.
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon E. Schoenfield, Jan 01 2024
STATUS
approved