3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53... The space between is, in order : 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6... Is there some sort of formula or algorithm?

*sort by* **best** latest

There is unfortunately no known pattern to the sequence of gaps between consecutive primes, but mathematicians did manage to prove that the density of primes below a given number x converges to a nice function of x. That function is Li(x), the logarithmic integral function. See Mathworld reference:

http://mathworld.wolfram.com/LogarithmicIntegral.h...

This theorem about the density of primes is known as the Prime Number Theorem. You can read more about the math behind it and the history of its study here:

You can help the HubPages community highlight top quality content by ranking this answer up or down.

Like bubba-math said, there is no pattern in the sequence of prime numbers. I wish there was, though. The largest known prime number right now has nearly 13 million digits and the computer that got the answer was able to claim a $100,000 for being the first to find a prime number with more than 10 million digits.

Prizes are still available for the first ones who can find a prime number with more than 100 million digits ($150,000) and another for one with a billion digits ($250,000).

You can help the HubPages community highlight top quality content by ranking this answer up or down.