A062529 Smallest prime p such that there is a gap of 2^n between p and the next prime.
2, 3, 7, 89, 1831, 5591, 89689, 3851459, 1872851947, 1999066711391, 22790428875364879
Offset: 0
Keywords
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.
Links
- Cino Hilliard, TwinPrimes Java code.
- Thomas R. Nicely, First occurrence prime gaps [For local copy see A000101].
- Thomas R. Nicely, Other tables of prime gaps
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
Comments