# Are primes randomly distributed?

There is a famous citation that says "It is evident that the primes are randomly distributed but, unfortunately, we don't know what 'random' means." R. C. Vaughan (February 1990)

I have this very clear but rather broad question that might be answered by different opinions and view points. However, my question is really not targeting an intuitive or philosophical answer, and I beg you for view points with a strength of mathematical foundation.

are primes randomly distributed? so then what is 'random' in this context?

A posterior I

A possible hint comes perhaps from the theory of complex dynamical systems.

It can be difficult to tell from data whether a physical or other observed process is random or chaotic, because in practice no time series consists of pure 'signal.' There will always be some form of corrupting noise, even if it is present as round-off or truncation error. Thus any real time series, even if mostly deterministic, will contain some randomness. All methods for distinguishing deterministic and stochastic processes rely on the fact that a deterministic system always evolves in the same way from a given starting point.(ref 1, 2, 3, and "Distinguishing random from chaotic data") - complying to latter, remind that every prime $p$ can be trivially identified by a sieving that applies prior primes $q<p$ so it is possible to determine that somehow the system evolves in the same way from a given starting point. Of course to take into account that time must be substituted by a walking index as well.

A posterior II

Thank you for all of many the comprehensive answers and discussions. This is a quite classic question on MSE and meanwhile we moved much forward. You are right that primes are not random as per above question. Indeed we could show that they are in their sequence some type of "deterministic chaos". We don't need the Riemann function for this purpose. The primes sequence is a so called "ordered iterative sequence". Meanwhile this has been further elaborated by this source: "The Secret Harmony of Primes" (ISBN 978-9176370001) http://a.co/iIHQqR8 Some of you correctly referred to sieving. It is crucial however that we regard sieving procedures as a subset of "interference" (incl. frequencies and amplitudes). We can iteratively apply interference rules in order to gain from the first prime 2, the next ordered sequence. This can be iterative continued in an "ordered" way and within exact boundaries of p-squares (for 100% certainty). Indeed, in order to construct an ordered sequence of primes you just need to begin with 2. The Riemann approach is charming but would raise difficulties since we don't have yet a proof of the hypothesis that connects the order of the non-trivial zeros with the primes. So if you apply Riemann, as some colleagues here suggest, we would need to say at any time in the begin of your argumentation something like "provided the Riemann hypothesis would be true...". Having in mind that the very unique rule that primes follow, is that in an interference scheme all odd prime frequencies dance on the base frequency of 2 (ordered iterative sequence), one may even give it a thought to something of a parallel in the Riemann transformed world, that all non-trivial zeros dance on 1/2. But latter remains not more than a tempting trivial speculation yet.

• I've seen you edited it, does it make sense to talk about noise in the prime numbers? I'm guessing it's weird but it's only a gut feeling. Still waiting for the more qualified person. Jun 16, 2013 at 9:53
• In fact we talk about noise in primes. There is quite extensive literature on this, see for instance here: arxiv.org/abs/1102.3648 Jun 16, 2013 at 9:55
• Oh! Thanks for the reference. Jun 17, 2013 at 1:41
• Another connection is to Cramer's probabilistic model, a conjecture that although primes are not random in some specified ways they behave as if they were random math.stackexchange.com/questions/680122/…. Sep 22, 2014 at 20:57
• Given the uncertain definition, this question is only a discussion and cannot be answered... Perhaps if you define random in not a such loosely way..... Jun 14, 2017 at 13:58

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.

• this is interesting general information but hardly focus on a clear and cristalized answer to the question: primes randomly distributed? so then what is 'random' in this context? Jun 15, 2013 at 22:09
• Did you read the article? Jun 15, 2013 at 22:12
• yes, I did. I also know the vids of Tery well. The book is new to me. Jun 15, 2013 at 22:16
• Also, I believe that there isn't a random in this context - I guess random means the absence of pattern, even in this case. But I'm not sure, I hope someone more qualified answers that for you. Good luck. Jun 15, 2013 at 22:18
• Section 4 of the article seems to very clearly cover your question (and could perhaps be added to this answer) : the primes behave very much like a random set with density approximately their density would, with the specific 'sieve constraints' (mod smaller primes) modifying constants on the random behavior (see e.g. the twin prime constant) but generally not changing asymptotics at all. Jun 17, 2013 at 20:13

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.

• Good points. Can you expand on "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" please, Is there any related theorem or conjuncture or result related to this statement? Jul 31, 2015 at 7:21

The answer to this question is now given by Eupraxis1981: I totally agree with the others who have commented, in that no arbitrary sequence of numbers is inherently random. For example, the sequence of primes (as you've pointed out) have been called random, yet we know that they can be represented by a (admittedly complex) system of Diophantine equations. So they form a rather well-ordered group, but just incredibly complicated... >>>here

Twin primes are not randomly distributed because there is a clear algebraic equivalence betwen integers of the form 6ab±a±b and integers of the form pn±k where p means any prime greater tan 3, k the value k corresponding to each prime for instance the value k of prime 5 is 1, the value k for prime 109 is 18 because (6*18) +1. Consequently we can sieve all integers of the form 6ab±a±b

• Your argument about the "clear algebraic equivalence" does not convince me. Can you give a link, paper, or direct proof of existence of the equivalence? Jun 17, 2017 at 6:48

The prime numbers is the set of numbers derived by removing the set of composite numbers from the set of natural numbers.

The pattern that the natural numbers follow is easily understood. The set of composite numbers also follow a discernable pattern:it is the union of the factors of 2, the factors of 3 etc.

Therefore the prime numbers as defined in the first paragraph must follow a pattern. No doubt the pattern is complex and we are yet to discover a way of defining it using a formula or formulas.

Distribution of primes completely determined by the following statement:

Positive integers which do not appear in both arrays $$A1(i,j)=6i^2+(6i−1)(j−1)$$ and $$A2(i,j)=6i^2+(6i+1)(j−1)$$:

                |  6   11    16     21   ...|
A1(i,j) =   | 24   35     46    57   ...|
| 54   71     88   105   ...|
| 96  119    142   165   ...|
|...  ...  ...   ...     ...|

|  6    13   20    27   ...|
A2(i,j) =   | 24    37   50    63   ...|
| 54    73   92   111   ...|
| 96   121  146   171   ...|
|...   ...  ...   ...   ...|


are indexes $$k$$ of primes in the sequence $$S1(k)=6k−1$$.

Positive integers which do not appear in both arrays $$A3(i,j)=6i^2−2i+(6i−1)(j−1)$$ and $$A4(i,j)=6i^2+2i+(6i+1)(j−1)$$:

                       | 4       9     14       19.. |
|20      31     42       53...|
|48      65     82       99...|
A3(i,j)= |88     111     134     157...|
|...   ...      ...     ...   |

| 8      15      22     29 ..|
|28     41       54     67...|
A4(i,j)= |60     79       98     117..|
|104   129      154    179...|
|...    ...     ...     ...  |


are indexes $$k$$ of primes in the sequence $$S2(k)=6k+1$$. Since all primes (except 2 and 3) are in one of two forms $$6k−1$$ or $$6k+1$$, so we can find primes simply by picking up positive integers which do not appear in these arrays.(C++ code see http://www.planet-source-code.com/vb/scripts/BrowseCategoryOrSearchResults.asp?lngWId=3&blnAuthorSearch=TRUE&lngAuthorId=21687209&strAuthorName=Boris%20Sklyar&txtMaxNumberOfEntriesPerPage=25

From the above statement it's obvious that in distribution of primes there is no any kind of randomness.