cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A268140 Smallest prime followed by at least 2^n nonprimes.

Original entry on oeis.org

3, 7, 23, 113, 523, 1327, 31397, 1357201, 436273009, 304599508537, 1693182318746371
Offset: 0

Views

Author

Alex Ratushnyak, Jan 27 2016

Keywords

Comments

a(16) <= 1931*A034386(1933)/7230 - 30244 (see J. K. Andersen link). Subsequence of A002386. - Chai Wah Wu, Feb 15 2016
From Chai Wah Wu, Jun 26 2019: (Start)
Upper bounds derived from data in Nicely:
a(11) <= 3001549619028223830552751967
a(12) <= 8298167160043173312303446808147809006055739815894846173
a(13) <= 293703234068022590158723766104419463425709075574811762098588798217895728858676728143227
a(14) <= 650094367*A034396(491)/2310 - 8936
a(15) <= 43882589*A034386(1063)/210 - 28456
a(17) <= 949*A034386(4691)/210 - 65386
a(18) <= 1111111111111111111*A034386(9293)/75201696570 - 138310
a(19) <= A034386(24137)/2310 - 311774
a(20) <= 587*A034386(43103)/2310 - 455704
a(21) <= A034386(90823)/510510 - 1065962
a(22) <= A034386(230077)/2229464046810 - 3131794
(End)

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.
		

Crossrefs

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