The sequence of prime gaps is graphic

Let us call a simple graph on $n\geq 2$ vertices a prime gap graph if its vertex degrees are $1$ and the first $n-1$ prime gaps. We show that such a graph exists for every large $n$, and in fact for every $n\geq 2$ if we assume the Riemann hypothesis. Moreover, an infinite sequence of prime gap graphs can be generated by the so-called degree preserving growth process. This is the first time a naturally occurring infinite sequence of positive integers is identified as graphic. That is, we show the existence of an interesting, and so far unique, infinite combinatorial object.


The problem
This paper grew out from an empirical observation by one of us (Z.T.): there are large graphs whose vertex degrees are consecutive members of the sequence of prime gaps.Moreover, such graphs can be generated recursively by the so-called degree preserving growth process [16].To turn the observation into precise mathematical statements, we introduce the following definition.
Definition.Let p n denote the n-th prime number, and let p 0 = 1.We call a simple graph on n 2 vertices a prime gap graph if its vertex degrees are p 1 − p 0 , . . ., p n − p n−1 .
In fact, as will become clear in the next subsection, Conjecture 1.2 implies Conjecture 1.1.By combining techniques from analytic number theory and matching theory, we are able to almost fully settle these conjectures.
Theorem 1.1.Conjectures 1.1 and 1.2 are true for every sufficiently large n.Assuming the Riemann hypothesis, they are true for every n 2.
The main input from analytic number theory is an upper bound on the sum of large prime gaps.The main input from matching theory is Vizing's theorem on edge colorings.See Subsection 1.3 for more details.In the next subsection, we discuss the background and motivation for Theorem 1.1.

Broader context
Networks are powerful, graph-based representations used in the study of complex systems.They appear in systems ranging from elementary particle interactions, through nucleosynthesis, chemistry, biology (gene interactions, protein interactions, metabolism, physiology), social sciences (human interactions), infrastructures (transportation, power grid, etc.), ecology (food webs) and climate, to the organization of visible and dark matter in the universe.In this paper we report on a novel family of networks, however, in number theory.
In this paper all graphs are simple: there are no parallel edges and loops.The most common characteristic of a graph is its degree sequence: we equip each of the n vertices with a unique label from {1, . . ., n}, and an integer vector D = (d 1 , . . ., d n ) lists the degrees of the corresponding labeled vertices, that is, the number of edges incident on a given vertex.In chemistry, and in old-fashioned graph theory, this is called valency.
The inverse problem is the following: we are given a sequence D of nonnegative integers, and we want to know whether there exists a graph with this ensemble as a degree sequence.When the answer is affirmative, then we call the sequence D graphic.Clearly, if the sequence is graphic, then the sum of its members must be even.However, it is not self-evident whether a given sequence is graphic.The most well-known characterization of graphic degree sequences is the following theorem: It is well-understood that there are exponentially many different realizations for almost every graphic degree sequence.At the same time, the number of all graphic degree sequences is infinitesimal compared to the number of integer partitions of the sum of the degrees.More precisely, let 2m denote the sum of the degrees (as usual), so that the degree sequence is a partition of 2m.By a difficult result of Pittel [23], as m tends to infinity, the probability of a random partition of 2m being graphic is zero in the limit.
Theorem 1.2 gives us a means to decide whether the degree sequence is graphic.It is, however, an entirely different problem to actually construct a realization of a graphic degree sequence.The simplest way to do that is via the Havel-Hakimi algorithm, which, in turn, is based on the following observation: Theorem 1.3 (Havel [12] and Hakimi [11]).Let Assume we are given a long sequence of natural numbers D such that every initial segment D n formed by the first n elements of D is graphic (we restrict this notion to n 2).This means, in particular, that d n < n for n 2. We would like to construct a realization G n for any n 2. Clearly, it can be done by separate applications of the Havel-Hakimi algorithm for every single n 2. But this is rather uneconomical: in principle, for each new segment we have to restart the algorithm from scratch.Instead, we want to find a graph growth dynamics (GGD) such that G n+1 can be obtained from G n rapidly.
There are only a few GGDs in the network science literature as most graph construction models are based on static algorithms.Arguably, the most popular GGDs is the preferential attachment algorithm of scale-free networks.However, in this and other GGDs, typically, some of the degrees of the vertices in G n+1 are bigger than in the degree sequence of G n , and thus, they are unsuitable for our purposes.
Recently, a new network growth dynamics has been introduced: the degree-preserving network growth (DPG) model family (see [8] or [16]).The DPG-process can be described as follows: let G be a simple graph with degree sequence D. In what follows, by a matching we mean a set of independent edges in the graph, that is, a set of pairwise non-adjacent edges.In a general step, a new vertex u joins G by removing a ν-element matching of G followed by connecting u to the vertices incident to the ν removed edges.The degree of the newly inserted vertex is d = 2ν.This step does not join two vertices of G that are non-adjacent, furthermore, the degrees of vertices in G are not changed.The degree sequence of the newly generated graph is D • d, that is, d is concatenated to the end of D. This graph operation is called a degree-preserving step (DP-step), and the DPG-process repeats such steps iteratively.
Returning to our long sequence D of natural numbers: if, for each step n, we can find a matching of size d n+1 /2 in G n , then the application of a DP-step provides a realization G n+1 of D n+1 .In this case, we say that the pair (G n , d n+1 ) is DPG-graphic.One can ask, why should a suitable matching be found in G n ?Actually, this is not inconceivable, as the following theorem shows: Theorem 1.4 (Theorem 2.5 in [18]).Given a graphic sequence D of length n and an even integer 2 d n, the sequence D • d is graphic if and only if D has a realization with a matching of size d/2.
Since every initial segment D n is graphic, therefore, for each one there exists a "special" realization G ′ n with the requested matching.However, it is not automatic that G ′ n = G n .A natural way to deal with this problem is to add the condition that every realization of D n has a matching of size d n+1 /2.
We stress that it is not easy to find an infinite, naturally occurring sequence D whose initial segments are all graphic, or at least graphic beyond a certain point.As a matter of fact, until now we have only known one such example: when all elements in the sequence are equal.Such a GGD describes an ever growing regular graph sequence.
In this paper, we describe for the first time a nontrivial, naturally arising infinite sequence whose initial segments are all graphic.Furthermore, we show that any realization of the initial segments is admissible for the DPG-algorithm.This sequence is the sequence of prime gaps with a prefix 1: The prefix 1 was included to guarantee that the sum of the initial segments is even.The figure below is an illustration of the DPG-process on prime gap graphs.The independent edges used by the DP-steps are red zigzags.The proof that the DPG-process creates an infinite sequence of prime gap graphs incorporates two main ingredients.The first one is a symmetric inequality, which implies the Erdős-Gallai inequalities, and thus provides a practical sufficient condition for the graphicality of the underlying degree sequence.Moreover, another new inequality implies the DPG-graphicality of a long sequence of natural numbers.The second ingredient combines classical L 2 and L ∞ bounds for prime gaps.
Theorem 1.5.If n is sufficiently large, then the initial segment PD n is graphic, and for any realization Ultimately, the proof relies on the rarity of zeros possibly violating the Riemann hypothesis.In principle, it allows one to deduce an effective constant beyond which Theorem 1.5 holds true, but this constant far exceeds the capabilities of computers.However, assuming the Riemann hypothesis, we can reduce the constant significantly and prove the result for all n 2.Here the numerics are quite delicate, and for efficiency we depart from the symmetric treatment alluded to above.Instead, we go back to first principles and examine the contribution of large prime gaps more directly.We still need to rely on computational results, but they can either be obtained with very simple computer programs, or found in the literature (e.g.prime gap records until 2 • 10 18 ).
Theorem 1.6.Assume the Riemann hypothesis.Then, for any n 2, the initial segment PD n is graphic, and for any realization G n of PD n , the pair (G n , p n+1 − p n ) is DPG-graphic.
Note that Theorems 1.5 and 1.6 are a reformulation of Theorem 1.1 in the terminology of combinatorics and network theory.They rely on the core theorems presented in the next subsection, which are of independent interest.

New results
Our first result provides, via two symmetric inequalities, sufficient conditions for a given sequence to be graphic and that in every graph realization of the sequence, there is a matching of a given size.
Theorem 1.7.Let D = (d 1 , . . ., d n ) be a sequence of positive integers such that D 1 = n ℓ=1 d ℓ is even.Let 1 < p ∞ be a parameter.Part (a).Assume that the following L p -norm bound holds: Then there is a simple graph G with degree sequence D. Part (b).Let G be any simple graph with degree sequence D. Assume that d 2 is an even integer satisfying Then the pair (G, d) is DPG-graphic, and consequently D • d is graphic.
Our second result makes explicit a theorem of Selberg [25, Th. 2].
Theorem 1.8.Assume the Riemann hypothesis.Then, for any x 2 and N > 0, we have Remark.The example x = 2 and N = 2 shows that this result would become false if we replaced the constant 163 by 4. On the other hand, Cramér's model predicts that it can be replaced by o(1) for x → ∞ (cf.[9, §1.1]).
In order to achieve the good numeric constant 163, we estimate carefully (among others) the error term in the truncated von Mangoldt formula for the Chebyshev psi function.This result, stated below, makes explicit a theorem of Goldston [10], and simultaneously extends and sharpens a theorem of Dudek Theorem 1.9.For any z > x > 10 18 we have where the sum is over the nontrivial zeros of the Riemann zeta function (counted with multiplicity).
2 Preliminary results
Lemma 2.1.Let G be a simple graph on n vertices with degrees d 1 , . . ., d n .Let δ 1 be an integer, and let d 2 be an even integer satisfying ( Then G has a matching of size d/2. Proof.Let us delete all vertices of degree at least δ (and the incident edges) from G. The remaining subgraph H has maximal degree less than δ, and number of edges at least by (5).It follows from Theorem 2.1 that the edge set of H can be partitioned into δ matchings, and then (6) shows that the largest matching in this decomposition must be of size at least d/2.Since H is a subgraph of G, the proof is complete.
Proof.With the help of the well-known integral representation (cf.[28, §12.31]) the statement becomes However, this one is clear, because the integrand is non-negative with a discrete set of zeros (there are no zeros when z is real).
Definition.For T > 0, we denote by N (T ) the number of zeros of ζ(s) with imaginary part in (0, T ), counted with multiplicity.
Remark.The exponent 5/8 + ε was improved multiple times, the current record 21/40 being due to Baker-Harman-Pintz [1].We have emphasized the classical result of Ingham [15] as it suffices for our purposes.In a restricted range, we have a stronger unconditional result thanks to explicit calculations.Lemma 2.7.For any x ∈ [117, 10 18 ], there is a prime number in [x, x + √ x].
Remark.The conclusion of Lemma 2.7 is likely true for all x 117.However, this statement is not known to follow from the Riemann hypothesis, and it is stronger than Oppermann's conjecture (which itself implies Legendre's conjecture, Andrica's conjecture, and Brocard's conjecture).

Proof of the main theorem
In this section, we first prove Theorem 1.5 assuming Theorem 1.7, and then we prove Theorem 1.6 assuming Theorem 1.8.In other words, we deduce Theorem 1.1 from Theorems 1.7 and 1.8.

Proof of Theorem 1.5
Let n be sufficiently large.We shall verify the conditions of Theorem 1.7 for while condition (3) reads Now ( 9) and ( 10) follow from Theorems 2.2 and 2.4, hence we are done: For p n < 10 18 we take N := max so that (11) simplifies to N (p n+1 − p n ) < p n .In fact the proof of Lemma 2.1 reveals that the last condition can be relaxed to which works better for very small n 5.For 5 n 44 the condition ( 12) can be checked by a simple computer program (or by hand).For n 45 and p n < 10 18 we verify (12) as follows.Let k be the unique positive integer satisfying (k − 1) 2 < p n < k 2 .Note that k 15, because p n p 45 = 197.From Lemma 2.7 it follows that p n+1 − p n k − 1 and k, hence also that Therefore, ( 12) is clear by For p n > 10 18 we take Then, by Theorems 2.3 and 1.8, we have From here the bound ( 11) is immediate, hence we are done.

A symmetric criterion for graphicality
In this section, we prove Theorem 1.7.

Part (a)
. By symmetry, we can assume that Since d ℓ 1 for any 1 ℓ n, it suffices to prove that This last condition follows from (2) and Hölder's inequality, hence we are done: In the last step, we used that both k 2 and n are upper bounded by max(k 2 , n).
Part (b).By Theorem 1.4 and Lemma 2.1, it suffices to verify that (5) holds for some integer δ 1.If p = ∞, then (3) says that 4d D ∞ D 1 , hence (5) holds for δ := 1 + D ∞ .So let us focus on the case 1 < p < ∞.For any integer δ 1, we have hence also So for the validity of ( 5), it suffices that In other words, it suffices to find an integer δ satisfying The left-hand side exceeds 1, hence δ exists as long as This is equivalent to condition (3), hence the proof of Theorem 1.7 is complete.

The sum of large prime gaps
In this section, we prove Theorem 1.8 assuming Theorem 1.9.Throughout, we assume the Riemann hypothesis.
First we eliminate some simple cases.Let N * denote the largest prime gap p ℓ+1 − p ℓ occurring in (4).
It follows from Theorem 1.9 and the crude bound y + δy < 3x that where As a result, Lemma 5.1.We have Proof.The bound |C(ρ)| < δ is a consequence of the integral representation x ρ−1 dx and the triangle inequality for complex-valued Riemann integrals.In addition, the triangle inequality for complex numbers yields by the definition of C(ρ) that We estimate the integral on the right-hand side of (15) as in the proof of [24,Lem. 5]: Here the contribution of ℑρ < 0 is the same as the contribution of ℑρ > 0. Therefore, applying Lemma 5.1 along with the elementary inequality We need to estimate the inner sum in (17).The idea is to drop the condition |ℑρ ′ | < 3x, and consider the full convergent series The first equality follows from the Riemann hypothesis, while the second equality follows from [20,Cor. 10.14].Let us write s := √ 6 + ρ for simplicity.Then, as in the proof of [20,Cor. 10.14], we have Γ ′ (s/2 + 1) Γ(s/2 + 1) .
We take the real part of both sides, and apply Lemma 2.2: To sum up, we have proved that Going back to (17), we conclude that In the sum on the right-hand side, we drop the condition ℑρ < 3x and replace |ρ| by ℑρ.By [2, Cor. 1, Lem. 5-6], the resulting bigger sum can be estimated as follows: In the end, we get Assume now that the prime p ℓ ∈ [x, 2x] satisfies p ℓ+1 − p ℓ N .There is at most one p ℓ such that (p ℓ + p ℓ+1 )/2 > 2x, so assume also that (p ℓ + p ℓ+1 )/2 2x.Then, for any is free of primes, hence counting the possible higher prime powers in this interval, we get That is, |E(y, δ)| > 0.997δy holds on (p ℓ , (p ℓ + p ℓ+1 )/2).Squaring and integrating, we get Summing over all such primes p ℓ , and using (18) as well as Theorem 2.3 for the possible single exceptional p ℓ , we obtain (4): where we relaxed the summation condition for convenience.If p(u) denotes the number of prime powers in [x − u, x + u], then the last sum can be written as Since 0 p(u) 2u + 1, the first term on the right-hand side is less than 2.001.
We note here that A(x) + B(x) is less than 2.1 log x log log x.
On the other hand, the residue theorem combined with (8) and Lemma 2. Finally, if x is an integer, then we make use of the following simple observation.For a fixed z > 10 18 , the ρ-sum on the right-hand side is continuous in x ∈ (10 18 , z), while the left-hand side equals ψ(x−) + Λ(x).Therefore, the previous formula is valid at x with an extra error term of O * (log x).We finish the proof of Theorem 1.9 by noting that A(x) + B(x) + 10 log x + 20 < 5 log x log log x, x > 10 18 .
[6,  Th. 1.3]  in the special case relevant for us.Here and later the notation A = O * (B) stands for |A| B.

Finally, there are
two n's satisfying |x − n| < 1, and by(20) their contribution to(19) is less than 1.003 log x.Collecting everything, we arrive at (with room to spare) f + O * (A(x) + B(x) + 6 log x).
(19)he Brun-Titchmarsh inequality in the form given byMontgomery and Vaughan [19, Th. 2], we also see that Indeed, on the right-hand side, the first term upper bounds the number of primes in [x − u, x + u], while the second term upper bounds the number of higher prime powers in [x − u, x + u].In particular, We infer from (24)-(26) that the n's satisfying log x < |x − n| x/5 contribute to(19)less than B(x) := 1.427 log x • (log log x − 2/5).Now we turn to the n's satisfying |x − n| > x/5.In this range we have | log(x/n)| > log(6/5), hence by Lemma 2.3 the corresponding n-subsum is at most