Sorting of prime gaps

Let gi be the ith prime gap pi+1pi.

If we re-arrange the sequence (gn,i)ni=1 so that for any finite n the gaps are arranged from smallest to largest we have a new sequence (ˆgn,i)ni=1.

For example, for n=10,


We can ask about the number of elements of the original sequence which are fixed under the sorting operation. For the example above gi=ˆgi for i=1,2,3,5,8.

The number of elements fixed by sorting appears to grow in a familiar way. Letting f(n) be the number fixed for given n :


For comparison, n and π(n) (number of primes not exceeding n) are:


and the ratio f(n)/π(n) at least for the numbers above appears to approach 1.

So my question is whether this might be an indirect consequence of the prime number theorem?


This process seems to approximate the number of primes on intervals generally. For example, if we sort the prime gaps from g120000 to g127000, 556 are fixed. And π(127000)π(120000)=600. So maybe a better way of putting the question is, why might it be true that


Some things I have looked at. The prime number theorem gives us that (gn) is not monotone. I don’t have an idea to support the suggestion that f(n)/n1/logn. If the probability (loosely speaking) that gk=^gk is 1/logn then maybe this can be explained in terms of the multiplicity, in some average sense, of gk in a particular finite sequence of gaps.

It occurs to me that if the number of gaps less than n of size (say) 2 is k(n), it is not possible to understand the probabilities involved without knowing whether k(n) is bounded as n gets large. So maybe the idea can be shown to be incorrect but showing it to be correct might require answering the threshold question about gaps.

Taking the suggestion above as true, assuming infinite gaps of all lengths (a conjecture of Polignac) and letting ck(n) be the number of prime gaps of length k for given n, if we assume also something akin to a well-distributed property in the distribution of gaps of length k (which follows in a qualified way from a conjecture of Hardy-Littlewood1) we have a simplification of notation based on geometry:


If nothing else the expression conveys the idea of an average. While it doesn’t seem fortuitous I cannot justify it.

Some numbers:


Edit: Some palaver replaced by an image that shows the distribution of the first million prime gaps in terms of deviation from PNT. The peak is at 0 (the graph is shifted by about 70). The spacing of indices of the 74195 fixed gaps (deviation = 0) is quite prime-like.


1 See Conjectures 3.2, 3.4 of this very readable note by Chris Caldwell.


Source : Link , Question Author : daniel , Answer Author : Community

Leave a Comment