## PRIMES IN THE INTERVALS BETWEEN PRIMES SQUARED

## KOLBJØRN TUNSTRØM

Abstract. The set of short intervals between consecutive primes squared has the pleasant-but seemingly unexploited-property that each interval s k := { p 2 k , . . . , p 2 k +1 - } 1 is fully sieved by the k first primes. Here we take advantage of this essential characteristic and present evidence for the conjecture that π k ∼ | s k | / log p 2 k +1 , where π k is the number of primes in s k ; or even stricter, that y = x 1 / 2 is both necessary and sufficient for the prime number theorem to be valid in intervals of length y . In addition, we propose and substantiate that the prime counting function π x ( ) is best understood as a sum of correlated random variables π k . Under this assumption, we derive the theoretical variance of π p ( 2 k +1 ) = ∑ k j =1 π j , from which we are led to conjecture that | π x ( ) -li( x ) | = O ( √ li( x )). Emerging from our investigations is the view that the intervals between consecutive primes squared hold the key to a furthered understanding of the distribution of primes; as evidenced, this perspective also builds strong support in favour of the Riemann hypothesis.

## 1. Introduction

An important theme in analytic number theory is the distribution of primes in short intervals. Notably, it is still an open question for what exact interval lengths the prime number theorem is valid or breaks down, as it eventually does for short enough intervals. The problem, formally stated, is to identify for which functions y = y x ( ), as x →∞ ,

$$\pi ( x + y ) - \pi ( x ) \sim \frac { y } { \log x }.$$

Currently, the gulf between the known upper and lower bounds of y is huge. The best unconditional estimate of the upper bound, proved by Heath-Brown [HeathBrown 1988], is y = x 7 / 12+ ( glyph[epsilon1] x ) , where glyph[epsilon1] ( x ) → 0 as x → ∞ , an estimate that is lowered to y = x 1 / 2+ glyph[epsilon1] assuming the Riemann hypothesis (RH). In contrast, Selberg, also assuming RH, proved that as long as y/ (log x ) 2 →∞ when x →∞ , then (1) holds for almost all x , understood in the sense that the set of x ∈ [0 , X ] for which (1) is not true is o X ( ) as X →∞ . Unconditionally, this almost-all result has been proven to hold with y = x 1 / 6 -glyph[epsilon1] [Zaccagnini 1998]. It was long thought that Selberg's result would be true even in the case of all x [Granville 1995b], but Maier [Maier 1985] made it clear that there are indeed infinitely many exceptions to Selberg's result, for any function of the form y = (log x ) λ , with λ &gt; 1. It is not known whether there exist exceptions that are larger than (log x ) λ , but it has been conjectured that y &gt; x glyph[epsilon1] will suffice for (1) to hold for all x , see e.g. [Granville 1995b] or [Soundararajan 2007].

In this paper we draw attention to the short intervals between consecutive primes squared, defined by s k := { p , . . . p 2 k 2 k +1 - } 1 for k ≥ 1. These intervals naturally occur in the context of the sieve of Eratosthenes, and in particular, each s k has

the specific quality of being fully sieved by the k first primes; any element in s k is either divisible by some p ∈ P k := { p , . . . , p 1 k } or else is a prime p / ∈ P k . In addition, the exact distribution of primes in s k is in its entirety build up of the periodic sequences

$$\rho _ { k } ( n ) \coloneqq \begin{cases} p _ { k } & \text{if $p_{k} \, | \, n$,} \\ 1 & \text{otherwise}, \end{cases}$$

which we visualise for the specific example of s 3 by the following table:

| n         | 25   | 26   | 27   | 28   |   29 | 30   |   31 | 32   | 33   | 34   | 35   | 36   |   37 | · · ·   | 48   |
|-----------|------|------|------|------|------|------|------|------|------|------|------|------|------|---------|------|
| ρ 1 ( n ) | 1    | p 1  | 1    | p 1  |    1 | p 1  |    1 | p 1  | 1    | p 1  | 1    | p 1  |    1 | · · ·   | p 1  |
| ρ 2 ( n ) | 1    | 1    | p 2  | 1    |    1 | p 2  |    1 | 1    | p 2  | 1    | 1    | p 2  |    1 | · · ·   | p 2  |
| ρ 3 ( n ) | p 3  | 1    | 1    | 1    |    1 | p 3  |    1 | 1    | 1    | 1    | p 3  | 1    |    1 | · · ·   | 1    |

Together with the fact that these intervals make up a complete subdivision of the natural numbers, these insights allow us to argue for the range in which the prime number theorem is valid, as well as providing a rudimentary explanation of the behaviour of the prime counting function π x ( ). Specifically, we present a heuristic as to why the following conjecture should hold:

Conjecture. The choice of y = x 1 / 2 is necessary and sufficient for

$$\pi ( x + y ) - \pi ( x ) \sim \frac { y } { \log ( x + y ) }$$

to hold for all x as x →∞ .

Furthermore, we present evidence that the set of π k s satisfies a conjecture of Montgomery and Soundararajan [Montgomery and Soundararajan 2004], that the number of primes in s k , denoted π k , is expected to follow a normal distribution with mean

$$\mu _ { k } = \frac { | s _ { k } | } { \log p _ { k + 1 } ^ { 2 } }$$

and standard deviation

$$\sigma _ { k } = \frac { \sqrt { | s _ { k } | \log ( p _ { k + 1 } ^ { 2 } / | s _ { k } | ) } } { \log p _ { k + 1 } ^ { 2 } }.$$

Because of the periodic structure of the sequences ρ k ( n ), the number of primes in two intervals s i and s j are not independent, but correlated. Following from this, we demonstrate that:

Remark. The prime counting function π x ( ) behaves -and should be understoodas a sum of correlated random variables π k , each normally distributed with mean µ k and standard deviation σ k .

Building on this insight, we formulate a random model of the primes, where the random variables are the number of primes in each interval s k , and where these variables derive from drawing random translations of the sequences ρ k ( n ). This construction naturally preserves the observed correlations between π k s. Moreover, assuming this model, we calculate the theoretical variance of π p ( 2 k +1 ) = ∑ k j =1 π j , which in turn suggests the conjecture

Conjecture. The error term in the prime number theorem satisfies

$$| \pi ( x ) - \text{li} ( x ) | = O \left ( \sqrt { \text{li} ( x ) } \right ).$$

In sum, it emerges that the apparent random behaviour of the primes and the prime counting function π x ( ) can be fundamentally understood in terms of the intervals s k and the underlying periodic sequences ρ k ( n ). Through Koch's equivalence criterium [von Koch 1901], our results also strongly support the correctness of the Riemann hypothesis, and as such might pave the way towards a complete technical proof.

## 2. Notation and definitions

We write the set consisting of the k first primes as P k := { p , . . . , p 1 k } , the intervals between consecutive primes squared as s k := { p , . . . , p 2 k 2 k +1 - } 1 , and the length of s k as l k := | s k | = p 2 k +1 -p 2 k , where k ≥ 1. As usual, the number of primes less than or equal to x is given by π x ( ), but in addition, since the number of primes in s k will appear frequently, we establish the shorthand notation

$$\pi _ { k } \coloneqq \pi ( p _ { k + 1 } ^ { 2 } ) - \pi ( p _ { k } ^ { 2 } ).$$

For the same reason, in the case when we apply the logarithmic integral,

$$\text{li} ( x ) \coloneqq \int _ { 2 } ^ { x } \frac { d t } { \log t },$$

to the interval s k , we write

$$\text{li} _ { k } \coloneqq \text{li} ( p _ { k + 1 } ^ { 2 } ) - \text{li} ( p _ { k } ^ { 2 } ).$$

Moreover, we need notation for the expected number of primes in s k -understood as the expected number of coprimes to p k #in a random interval of length l k (where p k # := ∏ p ∈P k p is the primorial of p k ). The probability of a random integer being coprime to p k # is given by the Euler product ∏ p ∈P k ( 1 -1 p ) , and multiplying this by l k produces the expected number of primes in s k , which we denote

$$\tilde { \pi } _ { k } \coloneqq l _ { k } \cdot \prod _ { p \in \mathcal { P } _ { k } } \left ( 1 - \frac { 1 } { p } \right ).$$

We now use this definition to construct a probabilistic prime counting function ˜( π x )-the expected number of primes less than or equal to x . By assuming k to be the integer such that p 2 k ≤ x &lt; p 2 k +1 , we define ˜( π x ) simply as the sum taken over the individual estimates ˜ π j , 1 ≤ j ≤ k , namely

$$\tilde { \pi } ( x ) \coloneqq \sum _ { j = 1 } ^ { k - 1 } \tilde { \pi } _ { j } + \frac { x - p _ { k } ^ { 2 } } { l _ { k } } \, \tilde { \pi } _ { k }.$$

The last term on the right side adjusts for the fact that x in general reaches only partially into the last interval s k .

Finally, we emphasise the fact that the distribution of primes within any interval s k can be viewed as a construction of k periodic sequences. To make this structure

apparent, we first define an arithmetic function that picks out the integers n coprime to a given prime p k ,

$$\rho _ { k } ( n ) \coloneqq \begin{cases} p _ { k } & \text{if $p_{k} \, | \, n$,} \\ 1 & \text{otherwise.} \end{cases}$$

Then we apply this definition to construct a second arithmetic function that locates all n coprime to p k #,

$$R _ { k } ( n ) \coloneqq \prod _ { 1 \leq i \leq k } \rho _ { i } ( n ).$$

By these definitions R k ( n ) = 1 whenever ( n, p k #) = 1, and both ρ k ( n ) and R k ( n ) are periodic, satisfying for any integer m the equalities

$$\rho _ { k } ( n + m p _ { k } ) = \rho _ { k } ( n ) \text{ \ and \ } R _ { k } ( n + m p _ { k } \# ) = R _ { k } ( n ).$$

Since s k is sieved completely by the k first primes, the primes within s k align with the 1s in R k , and therefore the number of primes in s k equals the number of 1s in R k across the interval. We visualise this for the specific example of s 3 by the following table:

| n         | 25   | 26   | 27   | 28   |   29 | 30          |   31 | 32   | 33   | 34   | 35   | 36      | 37   | · · ·   | 48      |
|-----------|------|------|------|------|------|-------------|------|------|------|------|------|---------|------|---------|---------|
| ρ 1 ( n ) | 1    | p 1  | 1    | p 1  |    1 | p 1         |    1 | p 1  | 1    | p 1  | 1    | p 1     | 1    | · · ·   | p 1     |
| ρ 2 ( n ) | 1    | 1    | p 2  | 1    |    1 | p 2         |    1 | 1    | p 2  | 1    | 1    | p 2     | 1    | · · ·   | p 2     |
| ρ 3 ( n ) | p 3  | 1    | 1    | 1    |    1 | p 3         |    1 | 1    | 1    | 1    | p 3  | 1       | 1    | · · ·   | 1       |
| R 3 ( n ) | p 3  | p 1  | p 2  | p 1  |    1 | p 1 p 2 p 3 |    1 | p 1  | p 2  | p 1  | p 3  | p 1 p 2 | 1 ·  | · ·     | p 1 p 2 |

But in general, if we pick a random interval ˜ s k of length l k , the 1s in R k across ˜ s k are not necessarily primes; all we know is that they are coprime to p k #. And because R k is periodic with period p k #, the number of coprimes to p k # in ˜ s k can take any out of p k # (non-unique) values; the probabilistic counting function ˜ π k is the mean value of these.

The last statement can be made explicit by applying sieve notation. Consider therefore an arbitrary interval A and denote the number of coprimes to p k # in A by

$$S ( A, p _ { k } \# ) \coloneqq | \{ n \, \colon n \in A, R _ { k } ( n ) = 1 \} |.$$

It follows from the periodicity of R k that S A,p ( k #) is periodic as well; if A j denotes A left-shifted j times, the equality

$$S ( A ^ { m \cdot p _ { k } \# }, p _ { k } \# ) = S ( A, p _ { k } \# )$$

holds for any integer m. Using this notation, it is obvious that we can restate the probabilistic prime counting function ˜ π k as the mean value taken over the sample space

$$\Omega _ { k } \coloneqq \{ S ( s _ { k } ^ { j }, p _ { k } \# ) \} _ { j = 0 } ^ { p _ { k } \# - 1 }.$$

In other words,

$$\tilde { \pi } _ { k } = \frac { 1 } { p _ { k } \# } \sum _ { j = 0 } ^ { p _ { k } \# - 1 } S ( s _ { k } ^ { j }, p _ { k } \# ).$$

The actual number of primes in s k coincides with the specific element in Ω k corresponding to j = 0,

$$\pi _ { k } = S ( s _ { k } ^ { 0 }, p _ { k } \# ) = S ( s _ { k }, p _ { k } \# ).$$

The prime counting function π k is therefore just one instance out of p k # elements in the sample space underlying ˜ π k . The crucial point, nonetheless, is that all elements in Ω k , π k inclusive, stem from the same underlying structure of k periodic sequences.

## 3. Approximate expressions for ˜ π k and ˜( π x )

From (2), we know that the expected number of primes in the interval s k can be expressed exactly in terms of

$$\tilde { \pi } _ { k } = l _ { k } \cdot \prod _ { p \in \mathcal { P } _ { k } } \left ( 1 - \frac { 1 } { p } \right ).$$

Applying Merten's product theorem, we attain the following approximation:

## Lemma 3.1.

$$\tilde { \pi } _ { k } \sim 2 e ^ { - \gamma } \frac { l _ { k } } { \log p _ { k + 1 } ^ { 2 } }.$$

$$\begin{smallmatrix} \\ \end{smallmatrix}$$

Proof. Assume that x is a real number within the interval s k , so that p 2 k ≤ x &lt; p 2 k +1 . Then we can state Merten's product theorem [Mertens 1874] as

$$\prod _ { p \in \mathcal { P } _ { k } } ( 1 - \frac { 1 } { p } ) = e ^ { - \gamma + \delta } \frac { 1 } { \log \sqrt { x } } = 2 e ^ { - \gamma + \delta } \frac { 1 } { \log x },$$

where γ is the Euler-Mascheroni constant and δ is a measure of the uncertainty of the approximation, satisfying

$$| \delta | < \frac { 4 } { \log ( \sqrt { x } + 1 ) } + \frac { 2 } { \sqrt { x } \log \sqrt { x } } + \frac { 1 } { 2 \sqrt { x } }.$$

By combining (2) and (5), it follows immediately that

$$\tilde { \pi } _ { k } = 2 e ^ { - \gamma + \delta } \frac { l _ { k } } { \log x }.$$

Additionally, (6) implies that in order to minimize the error we should choose x as large as possible-that is, x = p 2 k +1 -glyph[epsilon1] , where glyph[epsilon1] &gt; 0 is infinitesimal-by which we obtain (4). glyph[square]

Note that by the choice of x = p 2 k +1 in the proof above, the estimate of ˜ π k reflects the characteristic property of the sieving process; sieving by the k first primes removes all composites less than p 2 k +1 .

Similarly, we obtain an approximate expression for ˜( π x ):

## Lemma 3.2.

$$\tilde { \pi } ( x ) \sim 2 e ^ { - \gamma } \, \text{li} ( x ).$$

Proof. First, applying Lemma 3.1 to (3) we immediately have that

$$\tilde { \pi } ( x ) \sim 2 \mathrm e ^ { - \gamma } \left ( \sum _ { j = 1 } ^ { k - 1 } \frac { l _ { j } } { \log p _ { j + 1 } ^ { 2 } } + \frac { x - p _ { k } ^ { 2 } } { l _ { k } } \, \frac { l _ { k } } { \log p _ { k + 1 } ^ { 2 } } \right ).$$

The expression within parentheses is nothing but a Riemann sum, which in the continuum limit can be approximated by the logarithmic integral li( x ): The logarithmic integral taken over the interval s k satisfies

$$\frac { l _ { k } } { \log p _ { k } ^ { 2 } } > \text{li} _ { k } > \frac { l _ { k } } { \log p _ { k + 1 } ^ { 2 } },$$

and also,

We therefore have that

$$\tilde { \pi } _ { k } \sim 2 e ^ { - \gamma } \, \text{li} _ { k },$$

and eventually,

$$\tilde { \pi } ( x ) \sim 2 e ^ { - \gamma } \left ( \sum _ { j = 1 } ^ { k - 1 } \text{li} _ { j } + \frac { x - p _ { k } ^ { 2 } } { l _ { k } } \text{ li} _ { k } \right ) = 2 e ^ { - \gamma } \text{ li} ( x ).$$

We emphasise here again that the above results are derived under the sole assumption that s k is sieved by the k first primes. In this case, the best we can do is to assign a uniform probability of finding a prime in any position across s k . This probability is given exactly by ∏ p ∈P k ( 1 -1 p ) , or approximately by 2e -γ / log p 2 k +1 , Obviously, there is more to say about s k -illustrated with a few examples in the next section-and this additional information is what eventually will close the gap between ˜ π k and π k , where the latter is anticipated to satisfy

$$\pi _ { k } \sim \frac { l _ { k } } { \log p _ { k + 1 } ^ { 2 } }.$$

It is also worth noting that the expression 2e -γ li( x ) emerges as the continuum approximation to the discrete sum 2e -γ ∑ k j =1 l j / log p 2 j +1 , and not the other way around. This fact hints to the possibility that even the prime counting function π x ( ) is best approximated by ∑ k j =1 l j / log p 2 j +1 rather than li( x ). We examine this in closer detail in Section 6.

## 4. Shrinking the gap between ˜ π k and π k

Recall from Section 2 that the probabilistic prime counting function ˜ π k can be stated as

$$\tilde { \pi } _ { k } = \frac { 1 } { p _ { k } \# } \sum _ { j = 0 } ^ { p _ { k } \# - 1 } S ( s _ { k } ^ { j }, p _ { k } \# ),$$

while π k is given by

$$\pi _ { k } = S ( s _ { k } ^ { 0 }, p _ { k } \# ).$$

To close in on an estimate for π k , we need to shrink the sample space Ω k in such a way that it still contains S s , p ( 0 k k #). Of course, S s , p ( 0 k k #) is completely determined by where in the natural numbers the interval s k is situated (allowing for shifts that are multiples of p k #), so the constraints on Ω k must reflect this fact. While defining the right constraints is an essential part of sieve theory, our point

$$\frac { l _ { k } } { \log p _ { k } ^ { 2 } } \sim \frac { l _ { k } } { \log p _ { k + 1 } ^ { 2 } }.$$

here is only to illustrate with a few numerical examples how imposing constraints affect the probabilistic estimate ˜ π k .

The most obvious constraint is that all elements in R k ( n ) must be strictly smaller than p 2 k +1 whenever n ∈ s k . We can observe the effect of this constraint by expanding the Euler product (2) in terms of the the M¨bius function, which is defined o by

$$( 7 ) \quad \ \mu ( n ) \coloneqq \begin{cases} 1 & \text{if $n=1$,} \\ ( - 1 ) ^ { k } & \text{if $n$ is a product of $k$ distinct primes,} \\ 0 & \text{if $n$ has one or more repeated prime factors.} \end{cases}$$

It follows that we can rewrite (2) as

$$\tilde { \pi } _ { k } = l _ { k } \cdot \sum$$

Adding the constraint produces a truncated version, which we denote

$$\tau _ { k } = l _ { k } \cdot \sum _ { \sub$$

Numerically-as seen in Figure 1-we verify that the truncated expression amounts to a significant reduction of the sample space Ω k , resulting in τ k / l ( k / log p 2 k +1 ) ≈ 1 03, as opposed to ˜ . π / l k ( k / log p 2 k +1 ) ∼ 2e -γ ≈ 1 12. . In addition, the error term, which is O (2 k ) in the case of ˜ π k , reduces to O k ( 2 32 . ) in the case of τ k .

Figure 1. The ratios of π k , ˜ π k , and τ k to l k / log p 2 k +1 . The values are plotted at x = p 2 k +1 , 1 ≤ k ≤ 1000 . The three horizontal lines illustrate the limits tended to by each ratio.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-2a7e8f4c-8420-41ba-8713-48a6955b5fe1.jpg)

Our second example is a set of constraints on the internal structure of s k : Within s k , the first appearance of a composite divisible by p i , for i &lt; k , is in one of the positions p i -m +1, where m&gt; 0 is an element in the residue class of n 2 (mod p i ), j &gt; i ( m = 0 is not included, since the first position in s k is always occupied by

p 2 k ). For instance, given the primes p , . . . , p 1 6 , these are the possible positions of first appearance when k &gt; 6:

| Prime   | Candidate positions of first appearance in s k   |
|---------|--------------------------------------------------|
| p 1     | 2                                                |
| p 2     | 3                                                |
| p 3     | 2, 5                                             |
| p 4     | 4, 6, 7                                          |
| p 5     | 3, 7, 8, 9, 11                                   |
| p 6     | 2, 4, 5, 10, 11, 13                              |

The outcome is that these constraints bound the possible positions of sequences ρ i ( n ) across s k , 1 ≤ i ≤ k , effectively halving the sample space Ω k .

To get an impression of how these constraints impact the probabilist prime counting function ˜ π k , we randomly sample sequences of ρ i of length l k , 1 ≤ i ≤ k , with first appearance of p i in each sequence constrained as explained above, and count the number of 1s in the resulting R k -denoted η k . We observe in Figure 2 that the mean value of η k in fact appears to lie slightly above ˜ π k , while still satisfying η k ∼ ˜ π k . Note that in the figure we plot ∑ k j =1 η j rather than η k as the accumulation of biases is more visible than the individual biases in each interval. It appears therefore that the statistical properties of the reduced sample space do not change significantly from the original one, which can be understood from the fact that these constraints do not restrain the position of s k within the natural numbers.

GLYPH&lt;142&gt;

Figure 2. Comparison of ∑ k j =1 η j and ∑ k j =1 ˜ π j , with values plotted at x = p 2 k +1 , 1 ≤ k ≤ 500 . A) 200 samples of ∑ k j =1 ( η j -˜ ) π j (grey) shown together with the mean value 〈 ∑ k j =1 ( η j -˜ ) π j 〉 (black), demonstrating a statistical bias of η k &gt; π ˜ k . B) 200 samples of ∑ k j =1 η / j ∑ k j =1 ˜ π j (grey) shown together with the mean value 〈 ∑ k j =1 η / j ∑ k j =1 ˜ π j 〉 (black), indicating that η k ∼ ˜ π k .

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-81d556f1-29ae-4b31-b9ec-3702f05b7ce8.jpg)

## 5. Conjectures on the distribution of primes in short intervals

The prime number theorem, proven independently by Hadamard and de la Vall´e-Poussin in 1896, is usually stated by either of the equivalent relations e

$$\mu _ { 0 } \quad \pi ( x ) \sim \frac { \mu _ {$$

The results so far, however, motivates an alternative formulation of the prime number theorem, in the form of the conjecture:

## Conjecture 1. As k →∞ , we have that

$$\pi _ { k } \sim \frac { l _ { k } } { \log p _$$

From this perspective-as in the probabilistic case in Section 3-we should view π x ( ) ∼ li( x ) as originating from a continuum approximation of ∑ k j =1 l j / log p 2 j +1 .

Proving Conjecture 1 rigorously is out of reach for this paper, but we present a heuristic justification that hopefully can seed a complete proof. Specifically, we argue that the following conjecture holds, which in turn implies Conjecture 1:

## Conjecture 2. The choice of y = x 1 / 2 is necessary and sufficient for

$$\begin{array} {$$

to hold for all x as x →∞ .

To start with, let us consider what happens to an interval that grows slower than y = x 1 / 2 . For this purpose we define y glyph[epsilon1] = y glyph[epsilon1] ( x ) to be a function that grows arbitrarily slower than y . Naturally, no matter how large y glyph[epsilon1] is initially, as x increases, y glyph[epsilon1] eventually becomes infinitesimal compared to y . This has the effect that for any given integer q &gt; 0, we can find an x such that y glyph[epsilon1] ≤ y/ 2 . q It then follows from Bertrand's postulate-which says there is always a prime p such that n &lt; p &lt; 2 n -that

$$\pi ( y ) - \pi ( y _ { \epsilon } ) \geq \pi ( y ) - \pi ( y / 2 ^ { q } ) = q.$$

And because q can be arbitrarily large,

$$\lim _ { x \to \infty } \pi ( y ) - \pi ( y _ { \epsilon } ) = \infty.$$

Therefore, across s k we will always find that p k ≤ y &lt; p k +1 , while y glyph[epsilon1] lags behind and ultimately turns infinitesimal relative to infinitely many primes smaller than p k .

Let us explore the consequence of the last statement: As described earlier, an essential property of the distribution of primes in s k is that we can view it as a construction of the periodic sequences ρ j ( n ), 1 ≤ j ≤ k . From this perspective, it is clear that if we want to sample correctly the distribution of primes within s k , we need to choose y such that the interval [ x, x + ] spans at least the largest y underlying period, that is, y ≥ p k whenever x ∈ s k ; the slowest growing function that satisfies this criteria is y = x 1 / 2 . The interval [ x, x + y glyph[epsilon1] ], on the other hand, is in general only long enough to provide valid samples from the distribution of coprimes to p m #, where p m is the greatest prime smaller or equal to y glyph[epsilon1] across s k . Since, from our argument above, p m eventually grows infinitesimal relative to arbitrarily many primes smaller than p k , we should expect [ x, x + y glyph[epsilon1] ] to ultimately move repeatedly across regions where the density of primes deviates significantly from that predicted by the prime number theorem.

What this suggests is that y = x 1 / 2 is the sharp barrier below which the prime number theorem breaks down for all x , contradicting previous conjectures that this barrier lies close to y = x glyph[epsilon1] , glyph[epsilon1] &gt; 0 [Granville 1995b, Soundararajan 2007]. Furthermore, taking this reasoning to its conclusion, it seems logical to conjecture

a variation of Maier's theorem [Maier 1985] applied to any interval growing slower than x 1 / 2 :

Conjecture 3. Let y glyph[epsilon1] = y glyph[epsilon1] ( x ) satisfy lim x →∞ y /y glyph[epsilon1] = 0 , where y = x 1 / 2 . Then

$$\lim _ { x \to \infty } \frac { \pi ( x + y _ { \epsilon } ) - \pi ( x ) } { y _ { \epsilon } / \log x } > 1 \quad a n d \quad \liminf _ { x \to \infty } \frac { \pi ( x + y _ { \epsilon } ) - \pi ( x ) } { y _ { \epsilon } / \log x } < 1.$$

So far, we have argued that y = x 1 / 2 is a necessary condition for (8) to hold for all x . To substantiate that y = x 1 / 2 is also sufficient, we make the observation that the lengths of the intervals s k are of the form l k = 2 p k +1 g k -g 2 k , where g k := p k +1 -p k , and hence lie on the curves 2 √ xg -g 2 , with g = 2 n , n ≥ 1. Therefore, l k grows as O x ( 1 / 2 ). Let us further define y δ = y δ ( x ) to be a function that grows arbitrarily faster than y = x 1 / 2 , so that lim x →∞ y /y δ = ∞ . As a consequence, the interval [ x, x + y δ ] will eventually cover arbitrarily many intervals s k ; that is, for any m , we can always choose k so that y δ ( p 2 k ) ≥ ∑ k + m i = k l i . The problem we encounter now, however, is that the estimate

$$\pi ( p _ { k } ^ { 2 } + y _ { \delta } ) - \pi ( p _ { k } ^ { 2 } ) \sim \frac { y _ { \delta } } { \log ( p _ { k } ^ { 2 } + y _ { \delta } ) }$$

assumes a uniform distribution of primes in the interval [ p , p 2 k 2 k + y δ ], given by the density of primes in s m . But this assumption is inaccurate; the largest intervals across which we can suppose a uniform distribution are the intervals s k . Subdividing the natural numbers into intervals of length y δ and estimating the number of primes up to x from these results in an underestimate of the prime counting function π x ( ). At its most extreme, this is exemplified by the estimate π x ( ) ∼ x/ log x , which is well known to be an inferior guess of the number of primes up to x compared to π x ( ) ∼ li( x ), a fact that was established in 1899 by de la Vall´e-Poussin [de la e Vall´e-Poussin 1899]. e

One final note about this heuristic. We have only argued for what lengths y can take, in order for the interval [ x, x + ] to correctly sample the distribution of primes, y but not what is the correct limiting value of π x ( + ) y -π x ( ). The asymptotic limit in Conjecture 2 should therefore be considered as an assumption of the heuristic as well.

## 6. Numerical results on the distribution of primes

With the purpose of providing clues about how to understand the apparent random behaviour of the primes, we here examine the distribution of primes both locally and globally. We start by noting that since l k = 2 p k +1 g k -g 2 k , where g k = p k +1 -p k , we have that

$$\pi _ { k } \sim \frac { l _ { k } } { \log p _ { k + 1 } ^ { 2 } } = \frac { 2 p _ { k + 1 } g _ { k } - g _ { k } ^ { 2 } } { \log p _ { k + 1 } ^ { 2 } }.$$

Naturally, g k is not unique, suggesting that we can subdivide the set of intervals s k according to what the corresponding gap g k is. Hence, the subset of intervals s k all with corresponding gap g will be distributed along the curve

$$\begin{matrix} \sim \dots \dots \dots \dots \dots \dots \dots \dots \dots \\ \frac { 2 \sqrt { x } g - g ^ { 2 } } { \log x }, \end{matrix}$$

where g takes the values 2 n n , ≥ 1. This structure becomes apparent when plotting the values of π k as a function of p 2 k +1 , as illustrated in Figure 3, where all values of π k are plotted for 1 ≤ k ≤ 6 × 10 . 5

While this perspective clearly reveals how the intervals s k define an underlying pattern of the distribution of primes, it is possible to provide an even more compact viewpoint. According to a conjecture of Montgomery and Soundararajan [Montgomery and Soundararajan 2004], we should expect the primes in s k to follow a normal distribution with mean

$$\mu _ { k } = \frac { l _ { k } } { \log p _ { k + 1 } ^ { 2 } }$$

and standard deviation

$$\sigma _ { k } = \frac { \sqrt { l _ { k } ( \log ( p _ { k + 1 } ^ { 2 } / l _ { k } ) + B ) } } { \log p _ { k + 1 } ^ { 2 } }, \\. \quad. \quad.$$

where B = 1 -γ -log 2 π . Actually,

$$\frac { \sqrt { l _ { k } ( \log ( p _ { k + 1 } ^ { 2 } / l _ { k } ) + B ) } } { \log p _ { k + 1 } ^ { 2 } } \sim \frac { \sqrt { l _ { k } \log ( p _ { k + 1 } ^ { 2 } / l _ { k } ) } } { \log p _ { k + 1 } ^ { 2 } }, \\ \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \end{array}$$

but the latter expression does not give the same numerical accuracy for the data we have available, so we stick with σ k as defined.

Next, we apply Montgomery and Soundararajan's conjecture to generate normalised versions of the prime counting functions π k :

$$\overline { \pi } _ { k } \coloneqq \frac { \pi _ { k } - \mu _ { k } } { \sigma _ { k } }.$$

Assuming the conjecture holds, the result of this step should be that π k is normally distributed with mean 0 and standard deviation 1. This expectation is accurately confirmed by Figure 4, where we (A) plot π k as a function of k and (B) display a histogram revealing the probability distribution of π k . As such, this result lends support to Montgomery and Soundararajan's conjecture. But more importantly, it promotes the fundamental idea that we can view π k as a random variable with variance µ k and standard deviation σ k .

We turn now to the global distribution of primes, where we want to examine the behaviour of the prime counting function π x ( ) when it is expressed in terms of the individual prime counting functions π k :

$$\pi ( p _ { k + 1 } ^ { 2 } ) = \sum _ { j = 1 } ^ { k } \pi _ { j }.$$

To best get an impression of how π x ( ) behaves, we plot-rather than π x ( ) itselfthe error function

$$\epsilon ( x ) \coloneqq \pi ( x ) - \text{li} ( x ),$$

which produces the result seen in Figure 5. The first observation we make is that the error function starts out being negative-a famed bias that continues for the full stretch of our data set. Nonetheless, as Littlewood proved [Littlewood 1914], if we persist in moving x towards infinity, the error term will eventually shift sign, and it will continue to do so infinitely many times over. When that happens for the first time, however, no one knows, though it has been proved that x = 1 39822 . × 10 316 is

Figure 3. The number of primes π k in each interval s k plotted at the values x = p 2 k +1 , 1 ≤ k ≤ 6 × 10 5 (black dots). The emerging curves relate to the specific gap values g , g ∈ { 2 4 , , . . . } , where the bottom curve corresponds to the set of intervals s k where g k = 2 , the second bottom g k = 4 , etc. The red curves show the corresponding theoretical estimates (2 √ xg -g 2 ) / log x .

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-cec30e0d-b809-4d3d-9437-40a91a8ad313.jpg)

Figure 4. (A) The normalised prime counting functions π k plotted as a function of k , 1 ≤ k ≤ 6 × 10 5 . (B) A histogram displaying the numerical probability distribution of π k , overlaid with the PDF of the normal distribution N (0 1) , (black). The measured mean and standard deviation of π k are 0 000(7) . and 1 000(8) . , respectively.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-c224554d-e4c7-493b-b219-cc00bd4927e1.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-615109ca-9325-4fcb-80d0-bfedd7715c63.jpg)

an upper bound for the event [Bays and Hudson 2000]. A probabilistic measure of the bias was provided in 1994, when Rubinstein and Sarnak [Rubinstein and Sarnak 1994]-assuming the Riemann hypothesis- calculated the logarithmic density of those x such that π x ( ) -li( x ) &gt; 0 to be around 0 00000026. .

According to Conjecture 1, however, li( x ) is a continuum approximation to the discrete sum ∑ k j =1 l j / log p 2 j +1 , and therefore we should expect the latter to be a better estimate of π x ( ). As we can tell from Figure 5, where we also have included curves of ∑ k j =1 ( l j / log p 2 j -li j ) and ∑ k j =1 ( l j / log p 2 j +1 -li j ), the statistical evidence

Figure 5. The error function glyph[epsilon1] ( x ) plotted at the values x = p 2 k +1 , 1 ≤ k ≤ 6 × 10 5 (black). Also shown are the differences ∑ k j =1 ( l j / log p 2 j -li j ) (red), and ∑ k j =1 ( l j / log p 2 j +1 -li j ) (blue), as well as one realisation of the sum ∑ k j =1 ω j (grey), where the ω k s are independent random variables each satisfying N (0 , σ k ) .

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-d1415ec7-ac02-4000-9dd7-ed35bd1b371a.jpg)

seems to indicate that the truth lies somewhere in between,

$$\sum _ { j = 1 } ^ { k } \frac { l _ { j } } { \log p _ { j + 1 } ^ { 2 } } < E [ \pi ( p _ { k + 1 } ^ { 2 } ) ] < \text{li} ( p _ { k + 1 } ^ { 2 } ).$$

To more accurately interpret this observation, we normalise the curves in Figure 5 by

$$\Delta _ { k } \coloneqq \frac { 1 } { 2 } \sum _ { j = 1 } ^ { k } \left ( \frac { l _ { j } } { \log p _ { j } ^ { 2 } } - \frac { l _ { j } } { \log p _ { j + 1 } ^ { 2 } } \right ),$$

which places the normalised differences

$$\left [ \sum _ { j = 1 } ^ { k } \left ( \frac { l _ { j } } { \log p _ { j + 1 } ^ { 2 } } - \text{li} _ { j } \right ) \right ] / \Delta _ { k } \text{ \ and \ } \left [ \sum _ { j = 1 } ^ { k } \left ( \frac { l _ { j } } { \log p _ { j } ^ { 2 } } - \text{li} _ { j } \right ) \right ] / \Delta _ { k }$$

approximately at the constant lines -1 and 1 respectively. We also normalise the error function, defined by

$$E _ { k } \coloneqq \frac { \epsilon ( p _ { k + 1 } ^ { 2 } ) } { \Delta _ { k } }.$$

The resulting curves are shown in Figure 6A, plotted as functions of k . We note that on the scale of the data available, E k fluctuates fairly stable around a mean value of -0 60. . This becomes even more apparent if we display the data in histogram form, as done in Figure 6B, where we see that the empirical probability distribution of E k resembles a normal distribution. A natural speculation therefore, is whether there in fact exists a constant c such that

$$\mathbf E \left [ \pi \left ( p _ { k + 1 } ^ { 2 } \right ) \right ] = c \cdot \mathbf l i \left ( p _ { k + 1 } ^ { 2 } \right ) - \left ( 1 - c \right ) \cdot \sum _ { j = 1 } ^ { k } \frac { l _ { j } } { \log p _ { j + 1 } ^ { 2 } }.$$

Figure 6. The normalised error function E k plotted as a function of k , 1 ≤ k ≤ 6 × 10 5 (A), as well as a probability density histogram of all values of E k (B). Also displayed in (B) is the PDF for a normal distribution with mean -0 60(4) . and standard deviation 0 12(1) . estimated from all E k .

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-e598e4a7-ff30-4631-bcff-606d6059ded9.jpg)

Returning to Figure 5, we end with one final important observation: The error function glyph[epsilon1] ( x ) does not conform to a sum of independent random variables. This is clearly visible when comparing with an example of an actual sum of independent random variables ω k , where ω k ∼ N (0 , σ k ); the error function does not display the same scale of fluctuations as ∑ k ω k , and as already discussed, lingers more densely around a mean value. As will be apparent later, what causes the discrepancy between the error function glyph[epsilon1] ( x ) and ∑ k j =1 ω j are correlations between the prime counting functions π k . These correlations even grow stronger for larger interval lengths l k , possibly explaining why the normalised error function E k in Figure 6A seems to fluctuate more slowly as k becomes large. Explaining these correlations and their effect on the error function will be the focus of the next sections. But for now, we summarise the numerical insights by the following remark:

Remark 1. The prime counting function π x ( ) behaves-and should be understoodas a sum of correlated random variables π k , each normally distributed with mean µ k and standard deviation σ k as conjectured in [Montgomery and Soundararajan 2004].

## 7. A random model for the distribution of primes

With the understanding we have developed so far, we now have in hand enough information to construct a random model of the prime counting function π x ( ). We start with emphasising the fundamental observation underlying the model; the exact distribution of primes up to p 2 k +1 is in its entirety build up of the k periodic sequences ρ j ( n ), 1 ≤ j ≤ k , each having the property that ρ j (0) = p j . We visualise this in the following table:

Importantly-and already discussed at length-within s k , only the k first sequences

| n           | 0     | 1   | 2   | 3   | 4   | 5   | 6   | 7   | 8   | 9   | 10   | 11   | 12   | 13   | 14   | 15   | · · ·   |
|-------------|-------|-----|-----|-----|-----|-----|-----|-----|-----|-----|------|------|------|------|------|------|---------|
| ρ 1 ( n )   | p 1   | 1   | p 1 | 1   | p 1 | 1   | p 1 | 1   | p 1 | 1   | p 1  | 1    | p 1  | 1    | p 1  | 1    | · · ·   |
| ρ 2 ( n )   | p 2   | 1   | 1   | p 2 | 1   | 1   | p 2 | 1   | 1   | p 2 | 1    | 1    | p 2  | 1    | 1    | p 2  | · · ·   |
| ρ 3 ( n )   | p 3   | 1   | 1   | 1   | 1   | p 3 | 1   | 1   | 1   | 1   | p 3  | 1    | 1    | 1    | 1    | p 3  | · · ·   |
| .           | .     | .   | .   | .   | .   | .   | .   | .   | .   | .   | .    | .    | .    | .    | .    | .    |         |
| .           | .     | .   | .   | . . | .   | .   | . . | . . | .   | .   | . .  | . .  | . .  | . .  | . .  | . .  | · · ·   |
| . ρ k ( n ) | . p k | . 1 | . 1 | 1   | . 1 | . 1 | 1   | 1   | . 1 | . 1 | 1    | 1    | 1    | 1    | 1    | 1    | · · ·   |

ρ j , 1 ≤ j ≤ k , are needed to completely determine the distribution of primes. Note also that the distribution of primes in s k correlates with the distribution of primes in all previous intervals s i , 1 ≤ i &lt; k , due to the periodicities of ρ j , 1 ≤ j ≤ i .

In formulating the model-which we hereafter refer to as the correlated random model -the essential idea is to keep the intervals s k , but to allow translations of the sequences ρ j , 1 ≤ j ≤ k . By this approach, we stay close to the original structure of the primes, but will eventually be able to get a theoretical grip on the correlations between intervals; as becomes apparent, this is exactly what we need to give a proper explanation of the error function glyph[epsilon1] ( x ).

The central object in the model is the random variable Π( ˜ p 2 k +1 ), which is defined in terms of a sum over the random variables Π : ˜ j

$$\tilde { \Pi } ( p _ { k + 1 } ^ { 2 } ) \coloneqq \sum _ { j = 1 } ^ { k } \tilde { \Pi } _ { j }.$$

To generate the random variables Π , 1 ˜ j ≤ j ≤ k , we randomly choose k corresponding integers m j , where m j ∈ { 0 1 , , . . . , p j - } 1 and then define the translated sequences

$$\hat { \rho } _ { j } ( n ) \coloneqq \rho _ { k } ( n + m _ { j } ).$$

As in Section 2, we construct a second arithmetic function; here with the purpose of locating all n such that n + m i , 1 ≤ i ≤ j , is coprime to p j #:

$$\hat { R } _ { j } ( n ) \coloneqq \prod _ { 1 \leq i \leq j } \hat { \rho } _ { i } ( n ).$$

The random variables Π ˜ j are now obtained by

$$\tilde { \Pi } _ { j } \coloneqq | \{ n \, \colon n \in s _ { j }, \hat { R } _ { j } ( n ) = 1 \} |.$$

Since the sequences ˆ , ρ j 1 ≤ j ≤ k , are drawn independent from each other, the expectation value of Π ˜ j is given by

$$E \left [ \tilde { \Pi } _ { j } \right ] = \tilde { \pi } _ { j } = l _ { j } \cdot \prod _ { p \in \mathcal { P } _ { j } } \left ( 1 - \frac { 1 } { p } \right ) \sim 2 e ^ { - \gamma } \frac { l _ { j } } { \log p _ { j + 1 } ^ { 2 } } \sim 2 e ^ { - \gamma } \, \text{li} _ { j },$$

and correspondingly,

$$E \left [ \tilde { \Pi } ( p _ { k + 1 } ^ { 2 } ) \right ] = \sum _ { j = 1 } ^ { k } \tilde { \pi } _ { j } \sim 2 e ^ { - \gamma } \sum _ { j = 1 } ^ { k } \text{li} _ { j } = 2 e ^ { - \gamma } \text{li} ( p _ { i + 1 } ^ { 2 } ).$$

Note that the model as stated does not produce the correct mean. This can easily be overcome be introducing the random variables

$$\Pi _ { j } \coloneqq \frac { e ^ { \gamma } } { 2 } \tilde { \Pi } _ { j } \ \text{ and } \ \Pi ( p _ { k + 1 } ^ { 2 } ) \coloneqq \sum _ { j = 1 } ^ { k } \Pi _ { j }.$$

However, our interest is not in the mean, but in the variance produced by this model, and for that purpose it is not essential whether the mean differs by a constant; we still expect the primes to be constrained by the same variance.

To continue, we write the variance of Π( ˜ p 2 k +1 ) as

$$\text{$to$ continue, we write $neq variance of $m(\psi_{k+1})$ as} \\ \text{Var} \left [ \tilde { \Pi } ( p _ { k + 1 } ^ { 2 } ) \right ] & = E \left [ \left ( \sum _ { j = 1 } ^ { k } \left ( \tilde { \Pi } _ { j } - \tilde { \pi } _ { j } \right ) \right ) ^ { 2 } \right ] \\ & = \sum _ { j = 1 } ^ { k } E \left [ \left ( \tilde { \Pi } _ { j } - \tilde { \pi } _ { j } \right ) ^ { 2 } \right ] + 2 \sum _ { 1 \leq i < j \leq k } E \left [ \left ( \tilde { \Pi } _ { i } - \tilde { \pi } _ { i } \right ) \cdot \left ( \tilde { \Pi } _ { j } - \tilde { \pi } _ { j } \right ) \right ]. \\ \text{As we see, the first expression after the last equality is a sum over the individual}$$

As we see, the first expression after the last equality is a sum over the individual variances, while the second expression contains all covariance terms; they are all appearing twice, thereby explaining the factor 2. Crucially, we can express the variance theoretically, and will do so in the next section.

For comparison, we also consider what we will refer to as the uncorrelated random model , where the sequences ˆ , 1 ρ j ≤ j ≤ k , are drawn anew for each interval s k . We formulate this model in terms of the random variables

$$\hat { \Pi } _ { j }, \, 1 \leq j \leq k, \quad \text{and} \quad \hat { \Pi } ( p _ { k + 1 } ^ { 2 } ) \coloneqq \sum _ { j = 1 } ^ { k } \hat { \Pi } _ { j }.$$

The expectation values of these random variables are the same as above for the correlated random model, but now the covariances between intervals are zero, so that the variance is simply

$$\text{Var} \left [ \hat { \Pi } ( p _ { k + 1 } ^ { 2 } ) \right ] = \sum _ { j = 1 } ^ { k } \text{E} \left [ \left ( \hat { \Pi } _ { j } - \tilde { \pi } _ { j } \right ) ^ { 2 } \right ].$$

To illustrate the behaviour of the random models, we generate 275 realisations of Π( ˜ p 2 k +1 ), as well as 275 realisations of Π( ˆ p 2 k +1 ), for 1 ≤ k ≤ 10 . 4 The result is displayed in Figure 7, where the different realisations are plotted with their mean subtracted. Notable is that the correlated random model exhibits less variance than the uncorrelated model, indicating that the covariance terms in the correlated model in general are negative. In the same figure, we also plot the error function

$$\epsilon ( p _ { k + 1 } ^ { 2 } ) \coloneqq \pi ( p _ { k + 1 } ^ { 2 } ) - \text{li} ( p _ { k + 1 } ^ { 2 } )$$

as well as the adjusted error function

$$\epsilon _ { 0 } ( p _ { k + 1 } ^ { 2 } ) \coloneqq \pi ( p _ { k + 1 } ^ { 2 } ) - \left [ c \cdot \text{li} \left ( p _ { k + 1 } ^ { 2 } \right ) - ( 1 - c ) \cdot \sum _ { j = 1 } ^ { k } \frac { l _ { j } } { \log p _ { j + 1 } ^ { 2 } } \right ],$$

where c ≈ 1 -0 604. . It is evident that both of these error functions display a behaviour that is closer to that of the correlated model.

It is worth contrasting the correlated random model with the famous Cramer random model [Cram´ er 1936] (see also [Granville 1995a] for a thorough review of Cramer's work). In Cramer's model each integer n , 1 ≤ n ≤ x , has the probability 1 / log n of being prime, which gives a correct estimate of the number of primes across long enough intervals. While the model has proved very valuable in conjecturing different properties of the prime numbers, for example on the distribution of prime gaps, it also has the apparent weakness that it does not preserve certain central characteristics of the primes, such as the fact that an even number other than 2 can never be prime. In our suggested model, on the other hand, we move away from

Figure 7. The error function glyph[epsilon1] ( x ) (black) and the adjusted error function glyph[epsilon1] 0 ( x ) (blue) plotted at the values x = p 2 k +1 , 1 ≤ k ≤ 10 4 , together with 275 realisations of the correlated random model (red) and 275 realisations of the uncorrelated random model (grey).

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-c6cb165e-1743-4e81-84de-2c8519a8f80d.jpg)

looking at each integer. Rather, the number of primes in each interval s k is treated as a random variable, and the correlation structure between intervals emerging from the underlying periodicities of ρ k is kept intact. In this sense, we expect our choice of model to better describe the behaviour of the prime counting function π x ( ).

## 8. Theoretical expressions for the variance of ˜ Π ( p 2 k +1 )

In an elementary calculation, Hausman and Shapiro [Hausman and Shapiro 1973] derived the variance of the number of reduced residues modulo n in an arbitrary interval of length h . We here extend to the general case of the covariance between two intervals A 1 and A 2 with corresponding lengths h 1 and h 2 that are separated by a distance q , and where in A 1 we regard the number of reduced residues modulo n 1 , and in A 2 the number of reduced residues modulo n 2 . The resulting expressions for the covariance we present here follows from a straight forward adaption of Hausman and Shapiro's proof.

Let

$$f _ { n } ( m ) \coloneqq \begin{cases} 1 & \text{if} \quad ( m, n ) = 1, \\ 0 & \text{if} \quad ( m, n ) > 1. \end{cases}$$

The function of f n ( m ) is to weed out coprimes to n . To count the number of such in an interval of length h , we define

$$F _ { n } ( m, h ) \coloneqq \sum _ { r = m } ^ { m + h - 1 } f _ { n } ( r ).$$

From a probabilistic perspective, the expected number of coprimes to n in an interval of length h is given by

$$h \frac { \Phi ( n ) } { n },$$

where Φ( n ) is Euler's totient function.

Denote now the number of coprimes to n 1 in A 1 and the number of coprimes to n 2 in A 2 by F n 1 ( m,h 1 ) and F n 2 ( m + q, h 2 ), respectively, where we assume n 1 ≤ n 2 and q ≥ 1. Then the covariance between F n 1 ( m,h 1 ) and F n 2 ( m + q, h 2 ) is given by

$$& \Gamma _ { n } \geq 1. \ \lim e \, \text{$covariance veuween $r_{n}\{m,n_{1}$} \, \text{and} \, r_{n_{2}\{m}+q,n_{2}$} \, $ \text{is given by} \\ & \quad G ( n _ { 1 }, n _ { 2 }, h _ { 1 }, h _ { 2 }, q ) \\ & \coloneqq \frac { 1 } { n _ { 1 } n _ { 2 } } \sum _ { m = 1 } ^ { n _ { 1 } n _ { 2 } } \left ( F _ { n _ { 1 } } ( m, h _ { 1 } ) - h _ { 1 } \frac { \Phi ( n _ { 1 } ) } { n _ { 1 } } \right ) \left ( F _ { n _ { 2 } } ( m + q, h _ { 2 } ) - h _ { 2 } \frac { \Phi ( n _ { 2 } ) } { n _ { 2 } } \right ) \\ & \quad = \frac { 1 } { n _ { 1 } n _ { 2 } } \sum _ { m = 1 } ^ { n _ { 1 } n _ { 2 } } F _ { n _ { 1 } } ( m, h _ { 1 } ) F _ { n _ { 2 } } ( m + q, h _ { 2 } ) - h _ { 1 } h _ { 2 } \frac { \Phi ( n _ { 1 } n _ { 2 } ) } { n _ { 1 } n _ { 2 } }. \\ & \text{Note that $G$ is periodic with respect to $q$ and has periodicity $n_{1}$,}$$

Note that G is periodic with respect to q and has periodicity n 1 ,

$$G ( n _ { 1 }, n _ { 2 }, h _ { 1 }, h _ { 2 }, q + n _ { 1 } ) = G ( n _ { 1 }, n _ { 2 }, h _ { 1 }, h _ { 2 }, q ).$$

For brevity, we only continue with the case when h 2 &gt; h 1 and n 1 and n 2 are both even. Similar expressions can be derived in the other cases. Under this assumption, and introducing the abbreviation

$$Q ( n _ { 1 }, n _ { 2 } ) \coloneqq \frac { 1 } { 2 } n _ { 1 } n _ { 2 } \prod _ { p | \left ( n _ { 1 } n _ { 2 } / ( n _ { 1 }, n _ { 2 } ) ^ { 2 } \right ) } \left ( 1 - \frac { 1 } { p } \right ) \prod _ { p | ( n _ { 1 }, n _ { 2 } ) ^ { \prime } } \left ( 1 - \frac { 2 } { p } \right ),$$

where n ′ denotes the largest odd divisor of n , we can express the sum after the last equality in (9) as

$$\text{where} \, n ^ { \prime } \text{ denotes the largest odd divisor of } n, \, \text{we can express the sum after the last} \\ \text{equality in } ( 9 ) \, & \text{as} \\ \sum _ { m = 1 } ^ { n _ { 1 } n _ { 2 } } F _ { n _ { 1 } } ( m, h _ { 1 } ) F _ { n _ { 2 } } ( m + q, h _ { 2 } ) = \\ Q ( n _ { 1 }, n _ { 2 } ) \sum _ { \substack { k = 1 \\ 2 | q + k - 1 } } ^ { h _ { 2 } - h _ { 1 } + 1 } h _ { 1 } \prod _ { \substack { p | ( n _ { 1 }, n _ { 2 } ) ^ { \prime } \\ p | ( q + k - 1 ) } } \left ( 1 + \frac { 1 } { p - 2 } \right ) + \\ Q ( n _ { 1 }, n _ { 2 } ) \sum _ { \substack { k = 1 \\ 2 | ( q + h _ { 2 } - h _ { 1 } + k ) } } ^ { h _ { 1 } - 1 } ( h _ { 1 } - k ) \prod _ { \substack { p | ( n _ { 1 }, n _ { 2 } ) ^ { \prime } \\ p | ( q + h _ { 2 } - h _ { 1 } + k ) } } \left ( 1 + \frac { 1 } { p - 2 } \right ) + \\ Q ( n _ { 1 }, n _ { 2 } ) \sum _ { \substack { k = 1 \\ 2 | ( q - k ) } } ^ { h _ { 1 } - 1 } ( h _ { 1 } - k ) \prod _ { \substack { p | ( n _ { 1 }, n _ { 2 } ) ^ { \prime } \\ p | ( q - k ) } } \left ( 1 + \frac { 1 } { p - 2 } \right ). \\ \text{For computational purposes, } G ( n _ { 1 }, n _ { 2 }, h _ { 1 }, h _ { 2 }, q ) \, \text{is most efficiently calculated using} \\ \text{this expression, and it underlies later numerical examples. } \text{ But it is possible to}$$

For computational purposes, G n , n , h ( 1 2 1 , h 2 , q ) is most efficiently calculated using this expression, and it underlies later numerical examples. But it is possible to derive a more compact theoretical expression in terms of the M¨bius function [see o (7)]. We also need the following definitions: For any square-free integer n ,

$$\rho ( n ) \coloneqq \prod _ { p | n } ( p - 2 ) ;$$

$$\gamma ^ { + } ( h, q, d ) \coloneqq \begin{cases} 0 & \text{if $d\nmid q+i$ for all $i$, where $1\leq i\leq d\left\{\frac{h}{d}\right\}$}, \\ 1 & \text{if $d\nmid q+i$ for some $i$, where $1\leq i\leq d\left\{\frac{h}\right\}$} ; \end{cases}$$

and

$$\left \{ \frac { q } { d } \right \} _ { 1 } \coloneqq \begin{cases} \left \{ \frac { q } { d } \right \} \quad \text{if $d\nmid q$}, \\ 1 \quad \text{if $d\,|\,q$}. \end{cases}$$

Then we can write the covariance G n , n , h ( 1 2 1 , h 2 , q ) on the equivalent form

$$( 1 0 ) \quad G ( n _ { 1 }, n _ { 2 }, h _ { 1 }, h _ { 2 }, q ) = \frac { 1 } { n _ { 1 } n _ { 2 } } Q ( n _ { 1 }, n _ { 2 } ) \sum _ { d | ( n _ { 1 }, n _ { 2 } ) ^ { \prime } } \frac { \mu ^ { 2 } ( d ) } { \rho ( d ) } \mathcal { B } ( h _ { 1 }, h _ { 2 }, q, d ),$$

where

$$\text{where} \quad & \mathcal { B } ( h _ { 1 }, h _ { 2 }, q, d ) \\ & = h _ { 1 } \left ( \frac { 1 } { 2 d } - \left \{ \frac { h _ { 2 } - h _ { 1 } + 1 } { 2 d } \right \} + \left \{ \frac { q + h _ { 2 } - h _ { 1 } } { 2 d } \right \} - \left \{ \frac { q } { 2 d } \right \} _ { 1 } \right ) \\ & - 2 d \left \{ \frac { h _ { 1 } } { 2 d } \right \} \left ( \left \{ \frac { h _ { 1 } } { 2 d } \right \} + \left \{ \frac { q + h _ { 2 } - h _ { 1 } } { 2 d } \right \} - \left \{ \frac { q } { 2 d } \right \} _ { 1 } \right ) \\ & + \gamma ^ { + } ( h _ { 2 } - h _ { 1 } + 1, q - 1, 2 d ) h _ { 1 } \\ & + \gamma ^ { + } ( h _ { 1 }, q + h _ { 2 } - h _ { 1 }, 2 d ) 2 d \left ( \left \{ \frac { h _ { 1 } } { 2 d } \right \} - \left ( 1 - \left \{ \frac { q + h _ { 2 } - h _ { 1 } } { 2 d } \right \} \right ) \right ) \\ & + \gamma ^ { - } ( h _ { 1 }, q, 2 d ) 2 d \left ( \left \{ \frac { h _ { 1 } } { 2 d } \right \} - \left \{ \frac { q } { 2 d } \right \} _ { 1 } \right ). \\ & \quad \cdots \quad. &. &. &. &. &. &. &. &. &. &. &. &. &.$$

Numerical investigations hints to a possible simplification of this expression, as some of the terms appear to always cancel each other, but this remains to be shown theoretically.

Whenever A 1 = A 2 , so that h 1 = h 2 = h and n 1 = n 2 = n , we can write H n,h ( ) := G n,n,h,h, ( 0), and (10) reduces to the variance derived in [Hausman and Shapiro 1973],

$$H ( n, h ) = \prod _ { p | n ^ { \prime } } \left ( 1 - \frac { 2 } { p } \right ) \sum _ { d | n ^ { \prime } } \frac { \mu ^ { 2 } ( d ) } { \rho ( d ) } d \left \{ \frac { h } { 2 d } \right \} \left ( 1 - \left \{ \frac { h } { 2 d } \right \} \right ).$$

Note that if we apply the inequality { x } (1 -{ } x ) ≤ x , we obtain the upper bound

$$H ( n, h ) \leq h \frac { \Phi ( n ) } { n }.$$

Returning to the random models in Section 7, we can now express the variance of the correlated model as

$$& \text{or use coverage} \text{ move as} \\ & \text{Var} \left [ \tilde { \Pi } ( p _ { k + 1 } ^ { 2 } ) \right ] = \sum _ { j = 1 } ^ { k } E \left [ \left ( \tilde { \Pi } _ { j } - \tilde { \pi } _ { j } \right ) ^ { 2 } \right ] + 2 \sum _ { 1 \leq i < j \leq k } E \left [ \left ( \tilde { \Pi } _ { i } - \tilde { \pi } _ { i } \right ) \cdot \left ( \tilde { \Pi } _ { j } - \tilde { \pi } _ { j } \right ) \right ] \\ & \quad = \sum _ { j = 1 } ^ { k } H ( p _ { j } \#, l _ { j } ) + 2 \sum _ { 1 \leq i < j \leq k } G ( p _ { i } \#, p _ { j } \#, l _ { i }, l _ { j }, p _ { j + 1 } ^ { 2 } - p _ { i + 1 } ^ { 2 } ).$$

$$\gamma ^ { - } ( h, q, d ) \coloneqq \begin{cases} 0 & \text{if $d\nmid q - i$ for all $i$, where $1\leq i\leq d\left\{frac{\hbar{d}}{\}$} \right\}$}, \\ 1 & \text{if $d\left|q-i$ for some $i$, where $1\leq i\leq d\left\{frac{\hbar{d}}{\}$} \right\}$} ; \end{cases}$$

Likewise, for the uncorrelated model,

$$\text{Var} \left [ \hat { \Pi } ( p _ { k + 1 } ^ { 2 } ) \right ] = \sum _ { j = 1 } ^ { k } \text{E} \left [ \left ( \hat { \Pi } _ { j } - \tilde { \pi } _ { j } \right ) ^ { 2 } \right ] = \sum _ { j = 1 } ^ { k } H ( p _ { j } \#, l _ { j } ).$$

From (11) it follows that

$$H ( p _ { j } \#, l _ { j } ) \leq l _ { j } \cdot \frac { \Phi ( p _ { j } \# ) } { p _ { j } \# } = l _ { j } \cdot \prod _ { p \in \mathcal { P } _ { j } } \left ( 1 - \frac { 1 } { p } \right ) \sim 2 e ^ { - \gamma } \frac { l _ { j } } { \log p _ { j + 1 } ^ { 2 } } \sim 2 e ^ { - \gamma } \, \text{li} _ { j },$$

which results in the variance of the uncorrelated model having the upper bound

$$\text{Var} \left [ \hat { \Pi } ( p _ { k + 1 } ^ { 2 } ) \right ] \leq 2 e ^ { - \gamma } \sum _ { j = 1 } ^ { k } \text{li} _ { j } = 2 e ^ { - \gamma } \text{ li} \left ( p _ { k + 1 } ^ { 2 } \right ).$$

## 9. Properties of the covariance function

In this section we present some general considerations on the behaviour of the covariance function G n , n , h ( 1 2 1 , h 2 , q ). Let us first have a look at the role of the relative position q of two intervals, when both are assumed to be sieved by the k first primes. As an example of this scenario, we show in Figure 8A a plot of G p ( 100 # , p 100 # , h 1 , 2 h , q 1 ) as a function of q for different values of h 1 . We observe that in each case, the covariance function reaches a negative minimum value when q = h 1 -the exact situation when the two intervals are adjacent-before slowly climbing towards zero again. In addition, the minimum values grow in size as the length of the intervals increases. While not shown in Figure 8A, this result also holds for arbitrary values of h 2 . Note, however, that the observed minimum values are not unique, as shown in Figure 8B, where we have plotted G p ( k # , p k # , h 1 , h 1 , q ) across its full period p k # for two values of h 1 .

The reason why q = h 1 corresponds to a minimum value of the covariance function can be understood in terms of the following heuristic: For the sake of argument, assume that A 1 and A 2 are both sieved by p k only, and that their lengths h 1 and h 2 satisfy h 1 + h 2 ≤ p k . Then we have that

$$F _ { p _ { k } } ( m, h _ { 1 } ) = h _ { 1 } - 1 \ \text{ or } \ F _ { p _ { k } } ( m, h _ { 1 } ) = h _ { 1 },$$

depending respectively on whether the interval A 1 lies across a multiple of p k or not. Likewise in the case of A 2 :

$$F _ { p _ { k } } ( m, h _ { 2 } ) = h _ { 2 } - 1, \text{ \ or \ } F _ { p _ { k } } ( m, h _ { 2 } ) = h _ { 2 }.$$

Under these assumptions, we have that

$$G ( p _ { k }, p _ { k }, h _ { 1 }, h _ { 2 }, q ) = \frac { 1 } { p _ { k } } \sum _ { m = 1 } ^ { p _ { k } } F _ { p _ { k } } ( m, h _ { 1 } ) F _ { p _ { k } } ( m + q, h _ { 2 } ) - h _ { 1 } h _ { 2 } \left ( \frac { p _ { k } - 1 } { p _ { k } } \right ) ^ { 2 }.$$

When A 1 and A 1 do not overlap, that is, q ≥ h 1 , we can write the sum after the equality in terms of three contributions,

$$\begin{array} { l } \text{equity in terms of unree contributions}, \\ \sum _ { m = 1 } ^ { p _ { k } } & F _ { p _ { k } } ( m, h _ { 1 } ) F _ { p _ { k } } ( m + q, h _ { 2 } ) \\ & = ( p _ { k } - h 1 - h _ { 2 } ) \cdot [ h _ { 1 } h _ { 2 } ] + h _ { 1 } \cdot [ h _ { 2 } ( h _ { 1 } - 1 ) ] + h _ { 2 } \cdot [ h _ { 1 } ( h _ { 2 } - 1 ) ] \\ & = h _ { 1 } h _ { 2 } ( p _ { k } - 2 ). \end{array}$$

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-653d8ac4-0da7-4298-a9be-8b4d26aab333.jpg)

Figure 8. Covariance plots: (A) G p ( 100 # , p 100 # , h 1 , 2 h , q 1 ) plotted for four different values of h 1 as a function of q . In each case, the covariance function is minimum at q = h 1 . (B) G p ( 4 # , p 4 # , h 1 , h 1 , q ) plotted for two different values of h 1 as a function of q across its full period. The plot illustrates that the minimum found at q = h 1 is in general not unique.

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-d955e90f-6078-4dff-b4cf-4140ecf7125f.jpg)

And if A 1 and A 2 do overlap, that is, 0 ≤ q &lt; h 1 , in terms of four contributions,

$$& \text{And if } A _ { 1 } \text{ and } A _ { 2 } \text{ do overlap, that is, } 0 \leq q < h _ { 1 }, \text{ in terms of four contributions,} \\ & \sum _ { m = 1 } ^ { p _ { k } } F _ { p _ { k } } ( m, h _ { 1 } ) F _ { p _ { k } } ( m + q, h _ { 2 } ) \\ & \quad = ( p _ { k } - h _ { 2 } - q ) \cdot [ h _ { 1 } h _ { 2 } ] + q \cdot [ ( h _ { 1 } - 1 ) h _ { 2 } ] + ( h _ { 1 } - q ) \cdot [ ( h _ { 1 } - 1 ) ( h _ { 2 } - 1 ) ] \\ & \quad \quad + ( h _ { 2 } - h _ { 1 } + q ) \cdot [ h _ { 1 } ( h _ { 2 } - 1 ) ] \\ & \quad = - q + h _ { 1 } + h _ { 1 } h _ { 2 } ( p _ { k } - 2 ). \\ & \text{Cmnaring these two sums } \text{ we see that } G ( n. \text{ $n$}. \text{ $h$}. \text{ $h$}. \text{ $a$} \text{ is minimised whenever}$$

Comparing these two sums, we see that G p , p ( k k , h 1 , h 2 , q ) is minimised whenever q ≥ h 1 , in which case

$$G ( p _ { k }, p _ { k }, h _ { 1 }, h _ { 2 }, q ) = - \frac { h _ { 1 } h _ { 2 } } { p _ { k } ^ { 2 } } < 0.$$

Note that the larger the product h h 1 2 is, the larger the absolute value of the covariance at its minimum, as we observe in Figure 8A.

Letting go of the restriction that h 1 + h 2 ≤ p k complicates the heuristic, since more careful accounting is needed; as does sieving the intervals by multiple primes. It seems realistic, however, that a proof can be produced to show that in general, G p ( k # , p k # , h 1 , h 2 , q ) takes on a negative minimum value whenever q = h 1 .

Aside the relative positions of intervals, a second aspect to consider is what primes each interval is sieved by. Again, assume two intervals, now with lengths h 1 and h 2 , where the first is sieved by the i first primes, and the second by the j first primes. Then we can write the covariance function as

$$G ( p _ { i } \#, p _ { j } \#, h _ { 1 }, h _ { 2 }, q ) = c _ { 1 } \prod _ { p | ( p _ { j } \# / p _ { i } \# ) } \left ( 1 - \frac { 1 } { p } \right ) - c _ { 2 } \prod _ { p \in \mathcal { P } _ { j } } \left ( 1 - \frac { 1 } { p } \right ),$$

where c 1 and c 2 are constants. Both products approaches 0 as j →∞ , and therefore we have that

$$\lim _ { j \to \infty } G ( p _ { i } \#, p _ { j } \#, h _ { 1 }, h _ { 2 }, q ) = 0.$$

Figure 9. The covariance function G p ( 10 # , p k # 100 100 , , , q ) plotted for two different values of q as a function of 10 ≤ k ≤ 1000 .

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-8a59e667-7f36-4bc4-8e02-044b6329a905.jpg)

This limit behaviour is illustrated in Figure 9; G p ( i # , p j # , h 1 , h 2 , q ) is plotted for two values of q , and in both cases it moves slowly towards 0 as j increases.

Combining these two insights-the covariance function is minimised for adjacent intervals and approaches zero as the difference in sieving steps between intervals increases- we anticipate that G p ( i # , p j # , l i , l j , p 2 j +1 -p 2 i +1 ) is negative when j -i is small, increasingly so when i and j both become large, and grows smaller in absolute value as the difference j -i increases. Hence, the sum

$$\sum _ { 1 \leq i < j \leq k } G ( p _ { i } \#, p _ { j } \#, l _ { i }, l _ { j }, p _ { j + 1 } ^ { 2 } - p _ { i + 1 } ^ { 2 } )$$

should be dominated by negative terms, implying that the variance of the correlated random model is bounded by the same upper bound as the uncorrelated random model. Thus,

$$\text{Var} \left [ \tilde { \Pi } ( p _ { k + 1 } ^ { 2 } ) \right ] \leq \sum _ { i = 1 } ^ { k } H ( p _ { i } \#, l _ { i } ) \leq 2 e ^ { - \gamma } \text{ li} ( p _ { k + 1 } ^ { 2 } ).$$

## 10. Comparing random models and empirical data

In order to verify the predictions stated in the previous section we now consider four cases: 1) The theoretical variance of the correlated random model; 2) The variance of the correlated random model estimated from sampled realisations of ˜ Π ( p 2 k +1 ) ; 3) The estimated variance of the prime counting function π x ( ) under the assumption that E π x [ ( )] = li( x ); and 4) The estimated variance of the prime counting function π x ( ) under the assumption that

$$E [ \pi \left ( p _ { k + 1 } ^ { 2 } \right ) ] = c \cdot \text{li} \left ( p _ { k + 1 } ^ { 2 } \right ) - ( 1 - c ) \cdot \sum _ { i = 1 } ^ { k } l _ { i } / \log p _ { i + 1 } ^ { 2 }.$$

Let us start with the separate contribution from the covariance terms between intervals. In the theoretical case, we write the sum

$$\sum _ { 1 \leq i < j \leq k } G ( p _ { i } \#, p _ { j } \#, l _ { i }, l _ { j }, p _ { j + 1 } ^ { 2 } - p _ { i + 1 } ^ { 2 } )$$

on the equivalent form

$$\sum _ { j = 1 } ^ { k - 1 } \left ( \sum _ { i = 1 } ^ { k - j } G ( p _ { i } \#, p _ { i + j } \#, l _ { i }, l _ { i + j }, p _ { i + j + 1 } ^ { 2 } - p _ { i + 1 } ^ { 2 } ) \right ),$$

and denote the expression in parentheses by

$$\kappa _ { \text{th} } ( j ) \coloneqq \sum _ { i = 1 } ^ { k - j } G ( p _ { i } \#, p _ { i + j } \#, l _ { i }, l _ { i + j }, p _ { i + j + 1 } ^ { 2 } - p _ { i + 1 } ^ { 2 } ),$$

where the label 'th' is short for theory. κ th ( j ) is therefore the sum over all covariance terms originating from j th nearest intervals. For example, κ th (1) gives the sum over all covariance terms for neighbouring intervals. We also need the total remaining contribution to the covariance for all j larger than some value d , which we obtain by

$$\sum _ { j > d } ^ { k - 1 } \kappa _ { \text{th} } ( j ).$$

Now to the second case, where we draw samples of Π ˜ ( p 2 k +1 ) = ∑ k i =1 ˜ Π . k We define the error function in each interval j as glyph[epsilon1] sim ,j := Π ˜ j -˜ , π j where the label 'sim' is short for simulation, and write the global error function as

$$\epsilon _ { \sin } ( p _ { k + 1 } ^ { 2 } ) \coloneqq \sum _ { j = 1 } ^ { k } ( \tilde { \Pi } _ { j } - \tilde { \pi } _ { j } ) = \sum _ { j = 1 } ^ { k } \epsilon _ { \sin, j }.$$

Then the measured variance of one realisation of Π ˜ ( p 2 k +1 ) can be expressed as

$$\text{Var} \left [ \tilde { \Pi } \left ( p _ { k + 1 } ^ { 2 } \right ) \right ] = \left ( \sum _ { j = 1 } ^ { k } \epsilon _ { \text{sim}, j } \right ) ^ { 2 } = \sum _ { j = 1 } ^ { k } \epsilon _ { \text{sim}, j } ^ { 2 } + 2 \sum _ { 1 \leq i < j \leq k } \epsilon _ { \text{sim}, i } \cdot \epsilon _ { \text{sim}, j }.$$

Similar to the theoretical case, we rewrite the sum

$$\sum _ { 1 \leq i < j \leq k } \epsilon _ { \sin, i } \cdot \epsilon _ { \sin, j }$$

as

$$\sum _ { j = 1 } ^ { k - 1 } \left ( \sum _ { i = 1 } ^ { k - j } \epsilon _ { \sin, i } \cdot \epsilon _ { \sin, i + j } \right ).$$

Since we are interested in the average taken over many realisations, we define

$$\kappa _ { \sin } ( j ) \coloneqq \left \langle \sum _ { i = 1 } ^ { k - j } \epsilon _ { \sin, i } \cdot \epsilon _ { \sin, i + j } \right \rangle,$$

and the total remaining contribution to the covariance for all j larger than some value d , by

$$\sum _ { j > d } ^ { k } \kappa _ { \sin } ( j ).$$

Finally, in the cases of the primes, we define

$$\epsilon _ { p r, j } \coloneqq \pi _ { j } - \text{li} _ { j } \text{ \ and \ } \epsilon _ { a d, j } \coloneqq \pi _ { j } - \left [ c \cdot \text{li} _ { j } - ( 1 - c ) \cdot \frac { l _ { j } } { \log p _ { j + 1 } ^ { 2 } } \right ],$$

where 'pr' and 'ad' denote primes and primes with adjusted mean, and obtain

$$\epsilon _ { p r } \left ( p _ { k + 1 } ^ { 2 } \right ) \coloneqq \sum _ { j = 1 } ^ { k } \epsilon _ { p r, j } \text{ \ and \ } \epsilon _ { a d } \left ( p _ { k + 1 } ^ { 2 } \right ) \coloneqq \sum _ { j = 1 } ^ { k } \epsilon _ { a d, j }.$$

Then, entirely analogous to the previous cases, we obtain

$$\kappa _ { \text{pr} } ( j ) \coloneqq \sum _ { i = 1 } ^ { k - j } \epsilon _ { p r, i } \cdot \epsilon _ { p r, i + j } \text{ \ and \ } \sum _ { j > d } ^ { k } \kappa _ { \text{pr} } ( j ),$$

and

$$\kappa _ { \text{ad} } ( j ) \coloneqq \sum _ { i = 1 } ^ { k - j } \epsilon _ { a d, i } \cdot \epsilon _ { a d, i + j } \text{ \ and \ } \sum _ { j > d } ^ { k } \kappa _ { \text{ad} } ( j ).$$

We now plot κ th ( j ), κ sim ( j ), κ pr ( j ), and κ ad ( j ) for different values of j up to a maximum d , as well as the remainder terms, all shown in Figure 10. The different plots are across different ranges of k -limited to smaller k in the first two cases due to increasing computational cost for large k -but we observe that they are all qualitatively similar, confirming that the primes behave according to the correlated random model. For direct comparison, we include κ pr (1) and κ pr (2) also in the plots of κ th ( j ) and κ sim ( j ). At this short range, however, the fluctuations of κ pr (1) and κ pr (2) are rather significant, so we are not able to determine whether κ pr ( j ) converges to the theoretical value of the correlated random model in the limit of large k . In fact, as will be evident when we plot the total variance in each case, it appears that the covariance functions κ pr ( j ) and κ ad ( j ) in general lie below κ th ( j ) as k grows large, and this might be what we actually observe in Figure 10A and more convincingly in Figure 10B.

As we anticipated in the previous section, the contribution to the covariance is largest when j is small; κ a (1) is more than a factor two larger than κ a (2) (here 'a' denotes any of 'th', 'sim', 'pr', or 'ad'). And as j grows larger, κ a ( j ) approaches zero in absolute value. Note though that while we can observe some κ a ( j ) being positive, the remainder terms in all cases add up to negative values.

Comparing Figure 10C and Figure 10D, we see that for small j , κ pr ( j ) and κ ad ( j ) are almost identical. However, for j large the remainder terms differ significantly. Assuming li( x ) to be the correct expectation value of π x ( ) produces large fluctuations in the remainder term, while a much smoother curve results from assuming the adjusted expectation value.

k

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-7aa8021c-bf77-4cea-a269-f6544b126e39.jpg)

k

Figure 10. The covariance sums κ th ( j ) (A), κ sim ( j ) (B), κ pr ( j ) (C), and κ ad ( j ) (D) plotted at the values x = p 2 k +1 . The legend applies for all three covariance sums. In (A), 1 ≤ k ≤ 300 , and data are plotted for each value of k , d 1 = 10 , and d 2 = 50 ; In (B), 1 ≤ k ≤ 10 3 , and data are plotted for every 10th value of k , d 1 = 10 , and d 2 = 200 . The curves are obtained by averaging over 275 individual samples; In (C) and (D), 1 ≤ k ≤ 6 × 10 5 , and data are plotted for every 500th value of k , d 1 = 10 , and d 2 = 1000 . In (A) and (B), κ pr (1) and κ pr (2) are included for comparison (dashed black and red, respectively).

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-0ffa603c-c84c-4f5d-8fb2-b3d703cfb43d.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-10238f26-f6ed-4d0b-9fd1-062d37a4d0a6.jpg)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-4196e267-53f1-45f3-aa3a-fa89da4a2fe6.jpg)

Next, we continue by examining the total variance in each case, or rather, the standard deviations, that are given by

$$\text{s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.s.}$$

In addition, we consider the standard deviations under the assumption that all covariance terms are zero, that is, corresponding to the uncorrelated random model. Hence,

$$\begin{array} { l } \text{re zero, that is, corresponding to the uncorrelat} \\ \\ \sigma _ { t h, 0 } \left ( p _ { k + 1 } ^ { 2 } \right ) \coloneqq \sqrt { \sum _ { j = 1 } ^ { k } H ( p _ { j } \#, l _ { j } ) }, \\ \\ \sigma _ { \text{sim}, 0 } \left ( p _ { k + 1 } ^ { 2 } \right ) \coloneqq \sqrt { \left \langle \sum _ { j = 1 } ^ { k } \epsilon _ { \text{sim}, j } ^ { 2 } \right \rangle }, \\ \\ \sigma _ { \text{pr}, 0 } \left ( p _ { k + 1 } ^ { 2 } \right ) \coloneqq \sqrt { \sum _ { j = 1 } ^ { k } \epsilon _ { \text{pr}, j } ^ { 2 } }, \quad \text{and} \\ \\ \sigma _ { \text{ad}, 0 } \left ( p _ { k + 1 } ^ { 2 } \right ) \coloneqq \sqrt { \sum _ { j = 1 } ^ { k } \epsilon _ { \text{ad}, j } ^ { 2 } }. \\ \\ \text{ide the upper bound we found earlier for the s} \\ \text{random model}. \end{array}$$

Finally, we include the upper bound we found earlier for the standard deviation of the uncorrelated random model:

$$\sigma _ { \text{ub} } \left ( p _ { k + 1 } ^ { 2 } \right ) \coloneqq \sqrt { 2 e ^ { - \gamma } \, \text{li} \left ( p _ { k + 1 } ^ { 2 } \right ) }.$$

The different standard deviations are plotted in Figure 11. Under the assumption of the uncorrelated model, we observe that the curves of σ pr 0 , and σ ad 0 , lie on top of each other and are not visibly different. They also lie close to the theoretical value σ th 0 , , as shown in Figure 11A, and in fact seems to converge to σ sim 0 , , as evidenced in Figure 11B.

Including correlations, we note in Figure 11A that σ pr starts out larger than σ th , but seems to stabilise below σ sim in Figure 11B. It appears that this trends continues in Figure 11C, but without comparison with the correlated random model, we cannot state this with certainty. In all cases, σ ad is small compared to σ pr .

As expected from the covariance contribution being negative, the total variance is always smaller than the variance of the uncorrelated model, which again is bounded by σ ub , placed far above any of the other curves.

## 11. The distribution of primes and the Riemann hypothesis

Considered an outstanding challenge in number theory, the Riemann hypothesis states that the real part of every non-trivial zero of the Riemann zeta function is 1/2, where the Riemann zeta function is defined by

$$\zeta ( s ) \coloneqq \sum _ { n = 1 } ^ { \infty } \frac { 1 } { n ^ { s } }.$$

The Riemann zeta function ties in tightly with the distribution of primes through the Euler product formula, which states that

$$\zeta ( s ) = \prod _ { p \in \mathcal { P } } \left ( 1 - \frac { 1 } { p ^ { s } } \right ) ^ { - 1 }.$$

Figure 11. Different standard variance functions plotted at the values x = p 2 k +1 (calculated from theory, samples from the correlated random model, and from the prime counting function π x ( ) ). The legends in (C) also applies to (A) and (B). In (A), 1 ≤ k ≤ 300 , and data are plotted for each value of k ; In (B), 1 ≤ k ≤ 10 3 , and data are plotted for every 10th value of k . The curves for σ sim and σ sim, 0 are obtained by averaging over 275 individual samples; In (C), 1 ≤ k ≤ 6 × 10 5 , and data are plotted for every 100th value of k .

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-461e9381-acf2-4c3c-b6f2-1524b0fab04b.jpg)

Our particular interest is in the fact that the Riemann hypothesis is equivalent to the upper bound on the error function being

$$\mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ {\mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \mu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \nu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu ^ { \prime } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu } \nu _ { \mu }$$

a statement proven by von Koch in 1901 [von Koch 1901].

Koch's criteria is far from being a tight upper bound; it is much wider than what we have conjectured-and justified-in the previous sections, namely that for x large enough,

$$| \pi ( x ) - \text{li} ( x ) | < 2 e ^ { - \gamma } \sqrt { \text{li} ( x ) }.$$

In fact, we know enough to conjecture an even tighter upper bound, expressed discretely at the values x = p 2 k +1 , as

$$| \pi \left ( p _ { k + 1 } ^ { 2 } \right ) - \text{li} \left ( p _ { k + 1 } ^ { 2 } \right ) | < \sqrt { \sum _ { j = 1 } ^ { k } \frac { l _ { j } \log \left ( p _ { j + 1 } ^ { 2 } / l _ { j } \right ) } { \left ( \log p _ { j + 1 } ^ { 2 } \right ) ^ { 2 } } }.$$

This statement follows from Montgomery and Soundararajan's conjecture discussed in Section 6; the expression on the right side of the inequality is an estimate of the standard deviation of the uncorrelated random model. Due to the negative

contribution to the variance from the covariance terms between intervals, this bound holds stance for the correlated random model and hence the primes. Furthermore, since Montgomery and Soundararajan's conjecture holds empirically, we should expect that the bound should align with the sum of squares of the error functions in each interval,

$$\sum _ { j = 1 } ^ { k } ( \pi _ { j } - \text{li} _ { j } ) ^ { 2 }.$$

We can also express (13) in continuous form. Observe that under the assumption of Cramer's conjecture [Cram´r 1936]-that is, e g j := p j +1 -p j = O ( (log p j ) 2 ) -we have that

$$\log \left ( p _ { j + 1 } ^ { 2 } / l _ { i } \right ) = \log p _ { j + 1 } ^ { 2 } - \log \left ( 2 g _ { j } p _ { j + 1 } - g _ { j } ^ { 2 } \right ) \sim \frac { 1 } { 2 } \log p _ { j + 1 } ^ { 2 },$$

which further implies

$$\sum _ { j = 1 } ^ { k } \frac { l _ { j } \log \left ( p _ { j + 1 } ^ { 2 } / l _ { j } \right ) } { \left ( \log p _ { j + 1 } ^ { 2 } \right ) ^ { 2 } } \sim \frac { 1 } { 2 } \sum _ { j = 1 } ^ { k } \frac { l _ { j } } { \log p _ { j + 1 } ^ { 2 } } \sim \frac { 1 } { 2 } \, \text{li} \left ( p _ { k + 1 } ^ { 2 } \right ).$$

We can therefore restate (13) as

$$| \pi ( x ) - \text{li} ( x ) | < \sqrt { \frac { 1 } { 2 } \text{ li} ( x ) }.$$

Neglecting any constant coefficients, we state this conjecture more generally as

Conjecture 4. The error term in the prime number theorem satisfies

$$| \pi ( x ) - \text{li} ( x ) | = O \left ( \sqrt { \text{li} ( x ) } \right ).$$

We continue by plotting the error function | π x ( ) -li( x ) | together with the different upper bounds, as shown in Figure 12. Note that because Koch's criteria is much larger than the other bounds, we use a logarithmic scale on the y -axis. As expected, we find that the discrete estimate in (13), corresponding to the uncorrelated random model, lies on top of the sum of squares (14) (in the plot we include the lower order term for higher accuracy), while the error function | π x ( ) -li( x ) | is placed well below these bounds. The continuous estimate (15) lies close to the discrete estimate (13), but a bit higher, since the lower order terms are not accounted for here; nonetheless, as x →∞ , we expect their relative distance to decrease. Slightly above these curves we find the upper bound of the uncorrelated random model (12). And finally, we observe that Koch's criteria for the Riemann hypothesis is residing high above all the other curves, leaving plenty of room below it.

Essentially then, by considering the prime counting function π x ( ) as a sum over correlated random variables, we have arrived at a fundamental explanation of why the Riemann hypothesis must be correct, as illustrated by the different theoretical bounds displayed in Figure 12. A purely technical proof still awaits, but perhaps what we have presented here can serve as a stepping stone towards one.

## References

C Bays and R H Hudson. A new bound for the smallest x with π x ( ) &gt; li x ( ). Math. Comput. , 69:1285-1296, 2000.

Figure 12. The error function | π x ( ) -li( x ) | and different upper bounds plotted at the values x = p 2 k +1 for every 100th value of k , 1 ≤ k ≤ 6 × 10 5 .

![image](https://ac.marcodsn.me/arxiv-markdown-images/1408.0420v2-figure-a7fe62c9-953f-45da-ae09-f974bddace22.jpg)

- H Cram´ er. On the Order of Magnitude of the Difference Between Consecutive Prime Numbers. Acta Arith. , 2:23-46, 1936.
- C J de la Vall´e-Poussin. Recherches analytiques sur la thorie des nombers premiers. e Ann. Soc. Sci. Bruxelles , 20:183-256, 1899.
- A Granville. Harald Cram´ er and the distribution of prime numbers. Scand. Actuarial J. , 1995(1):12-28, January 1995a.
- AGranville. Unexpected irregularities in the distribution of prime numbers. In Proceedings of the International Congress of Mathematicians (Z¨rich, 1994) u , volume 1,2, pages 388399. Basel, B¨rkhauser, 1995b. u
- M Hausman and H N Shapiro. On the mean square distribution of primitive roots of unity. Commun. Pure App. Math. , 26:539-547, 1973.
- D R Heath-Brown. The number of primes in a short interval. J. Reine Angew. Math. , 389:22-63, 1988.
- J W Littlewood. Distribution des Nombres Premiers. C. R. Acad. Sci. Paris , 158:18691872, 1914.
- H Maier. Primes in short intervals. Michigan Math. J. , 32(2):221-225, 1985.
- F Mertens. Ein Beitrag zur analytischen Zahlentheorie. J. Reine Angew. Math. , 78:46-62, 1874.
- H L Montgomery and K Soundararajan. Primes in short intervals. Commun. Math. Phys. , 252:589-617, 2004.
- M Rubinstein and P Sarnak. Chebyshev's bias. Exper. Math. , 3(3):173-197, 1994.
- K Soundararajan. The distribution of prime numbers. In Equidistribution in number theory, an introduction , pages 59-83. Springer, Dordrecht, 2007.
- H von Koch. Sur la distribution des nombres premiers. Acta Math. , 24(1):159-182, 1901.
- A Zaccagnini. Primes in almost all short intervals. Acta Arith. , 84(3):225-244, 1998.

E-mail address : kolbjorn@chalmers.se

Complex Systems Group, Department of Energy and Environment, Chalmers University of Technology, 41296 Gothenburg, Sweden
Kolbjørn Tunstrøm
Primes in the intervals between primes squared
The set of short intervals between consecutive primes squared has the
pleasant---but seemingly unexploited---property that each interval
$s_k:=\{p_k^2, \dots,p_{k+1}^2-1\}$ is fully sieved by the $k$ first primes.
Here we take advantage of this essential characteristic and present evidence
for the conjecture that $\pi_k \sim |s_k|/ \log p_{k+1}^2$, where $\pi_k$ is
the number of primes in $s_k$; or even stricter, that $y=x^{1/2}$ is both
necessary and sufficient for the prime number theorem to be valid in intervals
of length $y$. In addition, we propose and substantiate that the prime counting
function $\pi(x)$ is best understood as a sum of correlated random variables
$\pi_k$. Under this assumption, we derive the theoretical variance of
$\pi(p_{k+1}^2)=\sum_{j=1}^k \pi_j$, from which we are led to conjecture that
$|\pi({x})-\textrm{li}(x)| =O(\sqrt{\textrm{li}(x)})$. Emerging from our
investigations is the view that the intervals between consecutive primes
squared hold the key to a furthered understanding of the distribution of
primes; as evidenced, this perspective also builds strong support in favour of
the Riemann hypothesis.