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 g2 and g3 between the primes 3, 5, and 7.

For any integer n, the factorialn! is the product of all positive integers up to and including n. Then in the sequence

n!+2,n!+3,…,n!+n{\displaystyle n!+2,n!+3,\ldots ,n!+n}

the first term is divisible by 2, the second term is divisible by 3, and so on. Thus, this is a sequence of n − 1 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 gm ≥ N.

In reality, 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 of the integer, and therefore the ratio of the prime gap to the integers 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 e−k; 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.

Usually the ratio of gn / ln(pn) is called the merit of the gap gn . As of September 2017[update], the largest known prime gap with identified probable prime gap ends has length 6582144, with 216841-digit probable primes found by Martin Raab.[2] This gap has merit M = 13.1829. 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.[3][4]

As of December 2017[update], 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.[5]

The Cramér–Shanks–Granville ratio is the ratio of gn / (ln(pn))2.[5] The greatest known value of this ratio is 0.9206386 for the prime 1693182318746371. Other record terms can be found at OEIS: A111943.

We say that gn is a maximal gap, if gm < gn for all m < n.
As of August 2018[update] 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.[8] Other record (maximal) gap sizes can be found in OEIS: A005250, with the corresponding primes pn in OEIS: A002386, and the values of n in OEIS: A005669. The sequence of maximal gaps up to the nth prime is conjectured to have about 2ln⁡n{\displaystyle 2\ln n} terms[9] (see table below).

Bertrand's postulate, proven in 1852, states that there is always a prime number between k and 2k, so in particular pn+1 < 2pn, which means gn < pn.

The prime number theorem, proven in 1896, says that the "average length" of the gap between a prime p and the next prime is ln(p). 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 ϵ>0{\displaystyle \epsilon >0}, there is a number N{\displaystyle N} such that for all n>N{\displaystyle n>N}

gn<pnϵ{\displaystyle g_{n}<p_{n}\epsilon }.

One can also deduce that the gaps get arbitrarily smaller in proportion to the primes: the quotient

An immediate consequence of Ingham's result is that there is always a prime number between n3 and (n + 1)3, if n is sufficiently large.[14] The Lindelöf hypothesis would imply that Ingham's formula holds for c any positive number: but even this would not be enough to imply that there is a prime number between n2 and (n + 1)2 for n sufficiently large (see Legendre's conjecture). To verify this, a stronger result such as Cramér's conjecture would be needed.

meaning that there are infinitely many gaps that do not exceed 70 million.[18] A Polymath Project collaborative effort to optimize Zhang’s bound managed to lower the bound to 4680 on July 20, 2013.[19] In November 2013, James Maynard introduced a new refinement of the GPY sieve, allowing him to reduce the bound to 600 and show that for any m there exists a bounded interval with an infinite number of translations each of which containing m prime numbers.[20] Using Maynard's ideas, the Polymath project improved the bound to 246;[19][21] assuming the Elliott–Halberstam conjecture and its generalized form, N has been reduced to 12 and 6, respectively.[19]

holds for infinitely many values n, improving the results of Westzynthius and Paul Erdős. He later showed that one can take any constant c < eγ, where γ is the Euler–Mascheroni constant. The value of the constant c was improved in 1997 to any value less than 2eγ.[23]

Paul Erdős offered a $10,000 prize for a proof or disproof that the constant c in the above inequality may be taken arbitrarily large.[24] This was proved to be correct in 2014 by Ford–Green–Konyagin–Tao and, independently, James Maynard.[25][26]

Firoozbakht's conjecture states that pn1/n{\displaystyle p_{n}^{1/n}} (where pn{\displaystyle p_{n}} is the nth prime) is a strictly decreasing function of n, i.e.,

pn+11/(n+1)<pn1/n for all n≥1.{\displaystyle p_{n+1}^{1/(n+1)}<p_{n}^{1/n}{\text{ for all }}n\geq 1.}

If this conjecture is true, then the function gn=pn+1−pn{\displaystyle g_{n}=p_{n+1}-p_{n}} satisfies gn<(log⁡pn)2−log⁡pn for all n>4.{\displaystyle g_{n}<(\log p_{n})^{2}-\log p_{n}{\text{ for all }}n>4.}[30] It implies a strong form of Cramér's conjecture but is inconsistent with the heuristics of Granville and Pintz[31][32][33] which suggest that gn>2−εeγ(log⁡pn)2{\displaystyle g_{n}>{\frac {2-\varepsilon }{e^{\gamma }}}(\log p_{n})^{2}} infinitely often for any ε>0,{\displaystyle \varepsilon >0,} where γ{\displaystyle \gamma } denotes the Euler–Mascheroni constant.

Meanwhile, Oppermann's conjecture is weaker than Cramér's conjecture. The expected gap size with Oppermann's conjecture is on the order of

This is a slight strengthening of Legendre's conjecture that between successive square numbers there is always a prime.

Polignac's conjecture states that every positive even number k occurs as a prime gap infinitely often. The case k = 2 is the twin prime conjecture. The conjecture has not yet been proven or disproven for any specific value of k, but Zhang Yitang's result proves that it is true for at least one (currently unknown) value of k which is smaller than 70,000,000; as discussed above, this has been improved to 246.

The gap gn between the nth and (n + 1)st prime numbers is an example of an arithmetic function. In this context it is usually denoted dn and called the prime difference function.[34] The function is neither multiplicative nor additive.