Are primes randomly distributed?

The primes are not randomly distributed. They are completely deterministic in the sense that the $n$th prime can be found via sieving. We speak loosely of the probability that a given number $n$ is prime $({\bf P}(n\in {\mathbb P}) \approx 1/\log n)$ based on the prime number theorem but this does not change matters and is largely a convenience.

Some confusion is maybe due to the use of probabilistic methods to prove interesting things about primes and because once we put the sieve aside the primes are pretty inscrutable. They seem random in the sense that we cannot predict their appearance in some formulaic way.

On the other hand the primes have properties associated more or less directly with random numbers. It has been shown that the form of the "explicit formulas" (such as that of von Mangoldt) obeyed by zeros of the $\zeta$ function imply what is known as the GUE hypothesis: roughly speaking the zeros of the $\zeta$ function are spaced in a non-random way. The eigenvalues of certain types of random matrices share this property with the zeros. There is a proof of this.$^1$

So it can be said that the primes are a deterministic sequence that via the $\zeta$ function share a salient feature with putatively random sequences.

In response to the particular question, "random" here is the "random" of random matrix theory. The paper trail is pretty clear from the work below and it's not a subject that fits into an answer box.

$^1$ Rudnick and Sarnak, Zeros of Principal L-Functions and Random Matrix Theory, Duke Math. J., vol. 81 no. 2 (1996).


Terence Tao wrote about it, I've found this video and there's also one article called: Structure and randomness in the prime numbers, I've read it in the book: An Invitation to Mathematics: From Competitions to Research, by Dierk Schleicher and Malte Lackmann.

The article I mentioned can be found here.


The simple answer is no they are not random. Though I can not give you the mathematical formula to prove this, I can share with you the title of a book someone just suggested I read by Mark Kac, called Statistical Independence in Probability. I can also point out that since Prime numbers are factual things that are always going to be in the same numerical location no matter what number system you use, that they can not be random (random in the simplest layman's understanding of that word that is) they must therefor have a pattern. We just do not yet "FULLY" comprehend it.