
A prime gap is the difference between two successive
prime number
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only way ...
s. The ''n''-th prime gap, denoted ''g''
''n'' or ''g''(''p''
''n'') is the difference between the (''n'' + 1)-th and the
''n''-th prime numbers, i.e.
:
We have ''g''
1 = 1, ''g''
2 = ''g''
3 = 2, and ''g''
4 = 4. The
sequence
In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is called ...
(''g''
''n'') of prime gaps has been extensively studied; however, many questions and conjectures remain unanswered.
The first 60 prime gaps are:
:1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 6, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 10, 6, 6, 6, 2, 6, 4, 2, ... .
By the definition of ''g''
''n'' every prime can be written as
:
Simple observations
The first, smallest, and only odd prime gap is the gap of size 1 between 2, the only even prime number, and 3, the first odd prime. All other prime gaps are even. There is only one pair of consecutive gaps having length 2: the gaps ''g''
2 and ''g''
3 between the primes 3, 5, and 7.
For any integer ''n'', the
factorial
In mathematics, the factorial of a non-negative denoted is the product of all positive integers less than or equal The factorial also equals the product of n with the next smaller factorial:
\begin
n! &= n \times (n-1) \times (n-2) ...
''n''! is the
product
Product may refer to:
Business
* Product (business), an item that serves as a solution to a specific consumer problem.
* Product (project management), a deliverable or set of deliverables that contribute to a business solution
Mathematics
* Prod ...
of all positive integers up to and including ''n''. Then in the sequence
:
the first term is divisible by 2, the second term is divisible by 3, and so on. Thus, this is a sequence of consecutive composite integers, and it must belong to a gap between primes having length at least ''n''. It follows that there are gaps between primes that are arbitrarily large, that is, for any integer ''N'', there is an integer ''m'' with .
However, prime gaps of ''n'' numbers can occur at numbers much smaller than ''n''!. For instance, the first prime gap of size larger than 14 occurs between the primes 523 and 541, while 15! is the vastly larger number 1307674368000.
The average gap between primes increases as the
natural logarithm
The natural logarithm of a number is its logarithm to the base of the mathematical constant , which is an irrational and transcendental number approximately equal to . The natural logarithm of is generally written as , , or sometimes, if ...
of these primes, and therefore the ratio of the prime gap to the primes involved decreases (and is asymptotically zero). This is a consequence of the
prime number theorem. From a heuristic view, we expect the probability that the ratio of the length of the gap to the natural logarithm is greater than or equal to a fixed positive number ''k'' to be ; consequently the ratio can be arbitrarily large. Indeed, the ratio of the gap to the number of digits of the integers involved does increase without bound. This is a consequence of a result by Westzynthius.
[.]
In the opposite direction, the
twin prime conjecture
A twin prime is a prime number that is either 2 less or 2 more than another prime number—for example, either member of the twin prime pair (41, 43). In other words, a twin prime is a prime that has a prime gap of two. Sometimes the term ''twin pr ...
posits that for infinitely many integers ''n''.
Numerical results
Usually the
ratio
In mathematics, a ratio shows how many times one number contains another. For example, if there are eight oranges and six lemons in a bowl of fruit, then the ratio of oranges to lemons is eight to six (that is, 8:6, which is equivalent to the ...
of
is called the ''merit'' of the gap ''g''
''n'' . , the largest known prime gap with identified
probable prime
In number theory, a probable prime (PRP) is an integer that satisfies a specific condition that is satisfied by all prime numbers, but which is not satisfied by most composite numbers. Different types of probable primes have different specific con ...
gap ends has length 7186572, with 208095-digit probable primes and merit ''M'' = 14.9985, found by Michiel Jansen using a sieve program developed by J. K. Andersen. The largest known prime gap with identified proven primes as gap ends has length 1113106 and merit 25.90, with 18662-digit primes found by P. Cami, M. Jansen and J. K. Andersen.
, the largest known merit value and first with merit over 40, as discovered by the
Gapcoin network, is 41.93878373 with the 87-digit prime 293703234068022590158723766104419463425709075574811762098588798217895728858676728143227. The prime gap between it and the next prime is 8350.
The Cramér–Shanks–Granville ratio is the ratio of ''g''
''n'' / (ln(''p''
''n''))
2.
If we discard anomalously high values of the ratio for the primes 2, 3, 7, then the greatest known value of this ratio is 0.9206386 for the prime 1693182318746371. Other record terms can be found at .
We say that ''g''
''n'' is a ''maximal gap'', if ''g''
''m'' < ''g''
''n'' for all ''m'' < ''n''.
the largest known maximal prime gap has length 1550, found by Bertil Nyman. It is the 80th maximal gap, and it occurs after the prime 18361375334787046697. Other record (maximal) gap sizes can be found in , with the corresponding primes ''p''
''n'' in , and the values of ''n'' in . The sequence of maximal gaps up to the ''n''th prime is conjectured to have about
terms (see table below).
Further results
Upper bounds
Bertrand's postulate
In number theory, Bertrand's postulate is a theorem stating that for any integer n > 3, there always exists at least one prime number p with
:n < p < 2n - 2.
A less restrictive formulation is: for every , there is always ...
, proven in 1852, states that there is always a prime number between ''k'' and 2''k'', so in particular ''p''
''n''+1 < 2''p''
''n'', which means ''g''
''n'' < ''p''
''n''.
The
prime number theorem, proven in 1896, says that the average length of the gap between a prime ''p'' and the next prime will asymptotically approach ln(''p''), the natural logarithm of ''p'', for sufficiently large primes. The actual length of the gap might be much more or less than this. However, one can deduce from the prime number theorem an upper bound on the length of prime gaps:
For every
, there is a number
such that for all
:
.
One can also deduce that the gaps get arbitrarily smaller in proportion to the primes: the quotient
:
Hoheisel (1930) was the first to show
that there exists a constant θ < 1 such that
:
hence showing that
: