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.

A062529 Smallest prime p such that there is a gap of 2^n between p and the next prime.

Original entry on oeis.org

2, 3, 7, 89, 1831, 5591, 89689, 3851459, 1872851947, 1999066711391, 22790428875364879
Offset: 0

Views

Author

Labos Elemer, Jun 25 2001

Keywords

Comments

a(11) <= 79419801290172271035479303914142441 and a(12) <= 55128448018333565337014555712123010955456071077000028555991469751. - Abhiram R Devesh, Aug 09 2014
From Zhining Yang, Dec 02 2022: (Start)
a(11) = 5333419265419188034369535864125349, 34 digits, discovered by Helmut Spielauer in 2013
a(12) = 55128448018333565337014555712123010955456071077000028555991469751, 65 digits, discovered by Helmut Spielauer in 2013
a(13) = 192180552346991956641101827551986346298837407139466361414211497406670710665021150917759713696699494356609164354068319457039591759, 129 digits, discovered by Dana Jacobsen in 2016
a(14) = 267552521*631#/210 - 9606, 268 digits, discovered by Dana Jacobsen in 2016
a(15) = 2717*1303#/268590 - 16670, 552 digits, discovered by Dana Jacobsen in 2014
a(16) = 7079*3559#/9870 - 36310, 1517 digits, discovered by Michiel Jansen, Pierre Cami, and Jens Kruse Andersen in 2013
a(17) = 1111111111111111111*9059#/(11#*5237) - 86522, 3899 digits, discovered by Hans Rosenthal in 2017
a(11) to a(17) were searched from Thomas R. Nicely's homepage. (End)
Importantly, the values in the previous comment are only upper bounds on a(11)-a(17), and are (almost certainly) not the correct values. As of this comment, the largest prime gap length whose first occurrence is known is 1676 < 2^11. - Brian Kehrig, May 01 2025

Examples

			a(2)=7 because 7 and 11 are consecutive primes with difference 2^2=4.
a(3)=89 because 89 and 97 are consecutive primes with difference 2^3=8.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[Prime[k + 1] != n + Prime[k], k++ ]; Prime[k]]; Do[ Print[ f[2^n]], {n, 0, 10}] (* Robert G. Wilson v, Jan 13 2005 *)
  • Python
    import sympy
    n=0
    while n>=0:
        p=2
        while sympy.nextprime(p)-p!=(2**n):
            p=sympy.nextprime(p)
        print(p)
        n=n+1
        p=sympy.nextprime(p)
    ## Abhiram R Devesh, Aug 09 2014

Formula

a(n) = A000230(2^(n-1)). - R. J. Mathar, Jan 12 2007
a(n) = A000230(2^(n-1)) = Min{p|nextprime(p)-p = 2^n} [may need adjusting since offset has been changed].

Extensions

a(10) sent by Robert G. Wilson v, Jan 13 2005
a(11)-a(12) removed by Brian Kehrig, May 01 2025