A196660 Smallest k>0 such that k*n+(n-1) is prime.
2, 1, 1, 1, 3, 1, 1, 2, 1, 1, 3, 1, 7, 2, 1, 1, 3, 2, 1, 2, 1, 1, 5, 1, 5, 3, 1, 2, 5, 1, 1, 3, 3, 1, 3, 1, 1, 2, 5, 1, 3, 1, 5, 2, 1, 2, 5, 3, 1, 2, 1, 1, 3, 1, 1, 2, 1, 2, 5, 2, 7, 6, 3, 1, 5, 1, 5, 3, 1, 1, 3, 4, 13, 5, 1, 1, 3, 2, 1, 2, 7, 1, 3, 1, 5, 2, 1, 2, 15
Offset: 1
Keywords
Examples
If n=13, the smallest prime in the sequence 25,38,51,64,77,90,103,... is 103, so a(13)=7.
Links
- Eric Weisstein's World of Mathematics, Linnik's Theorem
- Wikipedia, Linnik's theorem.
Programs
-
Mathematica
q[n_]:=(k=0; While[!PrimeQ[++k*n+n-1]]; k); Table[q[n],{n,1,100}]
-
PARI
a(n) = my(k=1); while (!isprime(k*n+(n-1)), k++); k; \\ Michel Marcus, Mar 18 2025
Comments