A354376 Smallest prime which is at the end of an arithmetic progression of exactly n primes.
2, 3, 7, 43, 29, 157, 907, 2351, 5179, 2089, 375607, 262897, 725663, 36850999, 173471351, 198793279, 4827507229, 17010526363, 83547839407, 572945039351, 6269243827111
Offset: 1
Examples
The arithmetic progression (5, 11, 17, 23) with common difference 6 contains 4 primes, but 29 = 23+6 is also prime, hence a(4) != 23. The arithmetic progression (7, 19, 31, 43) with common difference 12 also contains 4 primes, and 7-12 < 0 and 43+12 = 55 is composite; moreover this arithmetic progression is the smallest such progression with exactly 4 primes, hence a(4) = 43.
References
- R. K. Guy, Unsolved Problems in Number Theory, A5, Arithmetic progressions of primes.
Programs
-
Python
from sympy import isprime, nextprime def a(n): if n < 3: return [2, 3][n-1] p = 2 while True: for d in range(2, (p-3)//(n-1)+1, 2): if isprime(p+d) or isprime(p-n*d): continue if all(isprime(p-j*d) for j in range(1, n)): return p p = nextprime(p) print([a(n) for n in range(1, 11)]) # Michael S. Branicky, May 24 2022
Extensions
a(4) corrected and a(8)-a(13) from Michael S. Branicky, May 24 2022
Comments