A088732 First prime in the arithmetic progression n+k*(n+1) with k>0.
2, 3, 5, 7, 19, 11, 13, 23, 17, 19, 43, 23, 103, 41, 29, 31, 67, 53, 37, 59, 41, 43, 137, 47, 149, 103, 53, 83, 173, 59, 61, 127, 131, 67, 139, 71, 73, 113, 233, 79, 163, 83, 257, 131, 89, 137, 281, 191, 97, 149, 101, 103, 211, 107, 109, 167, 113, 173, 353, 179
Offset: 0
Keywords
Examples
For n=10, the progression starts: 10, 21, 32, 43, 54, 65, 76, 87, 98, 109, etc., 43 is the first prime: a(10)=43.
Links
- T. D. Noe, Table of n, a(n) for n = 0..10000
- Eric Weisstein's World of Mathematics, Dirichlet's Theorem
- Eric Weisstein's World of Mathematics, Linnik's Theorem
- Wikipedia, Linnik's theorem
- Index entries for sequences related to primes in arithmetic progressions
Programs
-
Haskell
a088732 n = head [q | q <- [2 * n + 1, 3 * n + 2 ..], a010051' q == 1] -- Reinhard Zumkeller, Oct 01 2014
-
Mathematica
Table[k = 1; While[p = n + k*(n + 1); ! PrimeQ[p], k++]; p, {n, 0, 100}] (* Frank M Jackson, Oct 20 2011 *)
-
Python
from itertools import accumulate, repeat from sympy import isprime def A088732(n): return next(m for m in accumulate(repeat(n+1),initial=(n<<1)+1) if isprime(m)) # Chai Wah Wu, Aug 02 2023