A268140 Smallest prime followed by at least 2^n nonprimes.
3, 7, 23, 113, 523, 1327, 31397, 1357201, 436273009, 304599508537, 1693182318746371
Offset: 0
Examples
3 is the smallest prime followed by 1 composite number, 7 is the smallest prime followed by 2 or more composite numbers, 23 is the smallest prime followed by 4 or more composite numbers, 113 is the smallest prime followed by 8 or more composite numbers.
Links
- Jens Kruse Andersen, Maximal Prime Gaps
- Thomas R. Nicely, Some Results of Computational Research in Prime Numbers [Local copy, pdf only] [ See local copy in A007053]
Programs
-
Mathematica
Table[p = 2; While[NextPrime@ p - p <= 2^n, p = NextPrime@ p]; p, {n, 0, 7}] (* Michael De Vlieger, Jan 27 2016 *)
-
PARI
a(n) = {my(p = 2); while(((q=nextprime(p+1)) - p) < 2^n+1, p = q); p;} \\ Michel Marcus, Jan 27 2016
-
Python
from sympy import isprime def A268140(n): p, n2 = 2, 2**n+1 while True: for i in range(1,n2): if isprime(p+i): p += i break else: return p # Chai Wah Wu, Feb 15 2016
Extensions
a(8)-a(10) taken from J. K. Andersen's Maximal Prime Gaps webpage by Chai Wah Wu, Feb 15 2016
Comments