← All articles
mathnumbersproblemsresearchSeptember 17, 20263 min read

How Far Apart Are the Primes? Gaps That Get Bigger and Never Stop Being Small

By the BrainSnail editorial team. How these articles are written and checked, and how to tell us when one is wrong.

Prime numbers thin out as they get larger and the spaces between them grow, and pairs only two apart keep appearing anyway. Whether they keep appearing forever is unproved and progress on it was sudden and recent.

How the primes thin out

Primes become rarer among larger numbers, and the rate is known precisely. The proportion of numbers up to a given size that are prime falls roughly as the reciprocal of the natural logarithm of that size, which is the substance of the prime number theorem, proved independently by two mathematicians in 1896. That means the average gap between consecutive primes near a number is about the natural logarithm of it, so near a million the average gap is around fourteen and near a trillion around twenty eight. Gaps of any size can be found, since a stretch of consecutive composite numbers as long as you like can be constructed directly, which shows the gaps grow without limit.

The small gaps that persist

Despite the thinning, close pairs keep occurring:

  • Twin primes differ by two and have been found among very large numbers
  • The twin prime conjecture holds that infinitely many exist and is unproved
  • Cousin primes differ by four and sexy primes by six
  • Prime triplets and larger clusters occur with predicted frequencies
  • A conjecture from 1923 predicts how often each pattern should appear and matches computation closely
  • Nobody has proved that any specific gap occurs infinitely often

The breakthrough of 2013

The problem stood essentially untouched until a sudden advance. Yitang Zhang, then working in relative obscurity, proved in 2013 that there are infinitely many pairs of primes differing by less than seventy million, which was the first proof that any finite bound works at all and which converted the question from one nobody could approach into one where the number could be reduced. A collaborative project immediately began improving the bound, involving many mathematicians working in public and bringing it down within months to a few hundred, and the current unconditional figure stands at 246. Reaching two, which would prove the twin prime conjecture, appears to require an idea nobody has, and the method used has a known limit above two.

How large primes are found

Finding very large primes is a practical activity with its own methods and its own community. Testing a number for primality by trial division is hopeless for anything large, so probabilistic tests are used, which either prove a number composite or establish that it is prime with a probability that can be made as close to certainty as desired by repeating them. For numbers of particular forms, faster deterministic tests exist, which is why nearly every record-holding prime is of one special form, being one less than a power of two. A distributed computing project has found the largest known primes since 1996 using volunteers' machines, and the records now run to tens of millions of digits, which are numbers with no practical use whatever and considerable recreational appeal.

Why anyone cares

The practical justification is weaker than the mathematical one and both are worth stating. Primes underpin public key cryptography, which relies on the difficulty of factoring large numbers into primes, so properties of their distribution matter to how keys are generated and to how confident anyone can be in the difficulty. Beyond that, questions about prime distribution have driven the development of whole areas of mathematics, with the techniques invented to attack them turning out to be useful elsewhere, which is the standard pattern and the honest answer. The distribution of primes also connects to one of the most famous unsolved problems in mathematics, concerning the zeros of a particular function, whose resolution would sharpen what is known about the gaps considerably.

The takeaway

The average gap near a number is roughly its natural logarithm, so gaps grow without limit and arbitrarily long runs of composite numbers can be constructed directly. Pairs differing by two keep appearing among very large numbers and nobody has proved they continue forever. A 2013 proof established that some finite gap recurs infinitely often, and collaboration reduced the bound to 246.

Practise this

Questions from Integers and Number Theory

Reading about something is not the same as being able to recall it. These are real questions from the Integers and Number Theory unit in our Math track, answers and explanations included. The unit has 120 in total across 21 steps.

  • Sort into groupsLevel 2

    1. Sort each number as Positive or Negative.

    Answer: -3 = Negative; 5 = Positive; -8 = Negative; 2 = Positive

    Numbers below zero are negative and numbers above zero are positive.

  • Build the sentenceLevel 2

    2. Build a true sentence about a square root.

    Answer: The square root of 36 is 6

    6 x 6 = 36, so the square root of 36 is 6.

  • Choose all that applyLevel 3

    3. Select all the numbers that are factors of 24.

    • 6correct
    • 8correct
    • 5
    • 9

    6 and 8 both divide 24 evenly, while 5 and 9 do not.