Preprint
Article

This version is not peer-reviewed.

Goldbach Sums in Progressions Modulo 2k: Almost-All Theorems and Shifted Primes

Submitted:

10 November 2026

Posted:

12 November 2026

You are already at the latest version

Abstract
We study the restricted weighted Goldbach sum Ra,q (N), in which one prime of a representation N=p1+p2 of an even N is restricted to the residue class a modulo q. If q has an odd prime factor l, then Ra,q (N)=Oq (logN) for every even N≡a (mod l), so the natural main term fails; we give the corrected main term for arbitrary q. For q=2k, an exact additive-shift decomposition and a factorisation of the singular-series coefficients, combined with the Siegel–Walfisz theorem and Vaughan’s minor-arc bound, give a mean-square estimate with saving (logX)-A for every fixed A>0 and an exceptional set of size OA,q (X(logX)-A). A transfer principle yields almost-all theorems along pn+pn+1, pn+pn+d and p+h, with relative accuracy along p+h. For moduli with an odd prime factor the obstruction recurs infinitely often along pn+pn+d, and for q=3 we characterise exactly when R1,3 (pn+pn+1)=0. We also prove a restricted ternary asymptotic with positivity for all large odd n; the representation p+1=3+q2+q3+q4 for every prime p>7, with the optimality of the anchor 3; an asymptotic formula for the weighted four-prime sum with its explicit singular series; and, along shifted primes, a limit law for the singular-series amplitude S0 (p+h) given by an explicit random Euler product Yh, with convergence of all moments, doubly exponentially thin tails and no atoms. The joint limit law of (S0 (p+1),S0 (p-1)) is a pair of random Euler products with strictly negatively dependent coordinates; for odd h the normalised restricted Goldbach function has the same limit law as S0 (p+h). Numerical studies of the digit-repulsion bias between consecutive primes are labelled with their exact range. This version incorporates the full Anchor–Helfgott theorem with its optimal anchor q1=3, and the joint limit law of the singular series at the shifts ±1. All theorems are unconditional, except Corollary 3.9, which rests on the imported lemma of Tolev (Theorem 3.8).
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  

1. Introduction

1.1. The Restricted Binary Goldbach Problem

For even N the classical weighted Goldbach counting function is
R ( N ) : = ∑ p 1 + p 2 = N ( log p 1 ) ( log p 2 ) ,
and the Hardy–Littlewood conjecture [1] predicts R(N)∼2C2𝔖0(N) N as N → ∞, where
S 0 ( N ) = ∏ l ∣ N l > 2 l − 1 l − 2 ,     C 2 = ∏ p > 2 1 − 1 ( p − 1 ) 2
is the twin-prime constant. This asymptotic is not a theorem; it is equivalent in strength to a strong form of the binary Goldbach conjecture. The corresponding almost-all statement, which bounds the exceptional set of N for which it fails, is a classical unconditional theorem going back to van der Corput, Chudakov and Estermann [2,3,4]; Montgomery and Vaughan [5] obtained a power saving X1−δ, and Pintz [6] made it explicit.
We study the refinement obtained by restricting one summand to a fixed reduced residue class modulo q: for q ≥ 1 and gcd(a,q) = 1,
R a , q ( N ) : = ∑ p 1 + p 2 = N p 1 ≡ a   ( q ) ( log p 1 ) ( log p 2 ) ,     M a , q ( N ) : = 2 C 2 φ ( q )   S 0 ( N )   N .
Write E(N):=Ra,q(N) − Ma,q(N) and ℰa,q(X):={N ≤ X even:Ra,q(N) = 0}. Equation (2) is the restricted counterpart of (1): summing the main term Ma,q(N) of (2) over the φ(q) reduced residue classes a modulo q gives back the Hardy–Littlewood main term for R(N) in (1), so that (2) simply distributes that main term equally among the reduced classes (compare Proposition 9.6(i)).

1.2. What This Paper Does and Does Not Claim

This paper is entirely unconditional except where a hypothesis is named in the statement of a result; no Generalized Riemann Hypothesis, density hypothesis or other unproved conjecture is used in any theorem whose label does not say so. It proves:
1.
an elementary local-obstruction theorem forcing the restriction to q = 2k for the main term Ma,q, together with the corrected main term for arbitrary q, a proof that its two closed forms agree, and, imported from a lemma of Tolev, an L1 mean-value theorem with that main term and the resulting almost-all statement on the admissible integers (Section 3);
2.
an exact additive-shift evaluation of the major arcs and the mean-square estimate ∑ N ≤ X | E ( N ) | 2 ≪ A , q X 3 ( log X ) − A (every fixed A > 0), hence #ℰa,q(X)≪A,qX(logX)−A (Section 4 and Section 5);
3.
a transfer principle giving almost-all theorems, with relative accuracy, along pn + pn+1, pn + pn+d and p + h, uniformly in the residue class of pn (Section 6);
4.
the obstruction along consecutive primes for moduli with an odd prime factor: an exact description of the zeros of R1,3(Nn), and the proof that the obstruction recurs infinitely often along pn + pn+d for every d ≥ 1 and every modulus with an odd prime factor (Section 7);
5.
exact computations of the digit-repulsion bias, the repetition of rays by gap size and the variance ratio of the second moment (Section 8 and Section 9), together with proofs of the ray–gap identity (Proposition 8.4), of the symmetry p1 ↔ p2 of the restricted sum (Proposition 9.1) and of the decomposition of the unrestricted error into restricted errors (Proposition 9.6);
6.
a restricted ternary asymptotic formula with positivity; the representation p + 1 = 3 + q2 + q3 + q4 for every prime p > 7 and the optimality of the anchor 3; and an asymptotic formula for the weighted four-prime sum, with its singular series, valid for every even integer (Section 10);
7.
the limit law, moments, tails and continuity of 𝔖0(p + h) along shifted primes, the limit law of the restricted Goldbach function itself along p + h, the joint limit law of (𝔖0(p + 1),𝔖0(p − 1)) with a certified enclosure of its limit correlation, and a bounded quaternary analogue (Section 11).
It does not claim: a pointwise Goldbach asymptotic for every large N, or Ra,q(p + h) > 0 for every large prime p; finiteness of E a , q : = ⋃ X E a , q ( X ) ; a power saving #ℰa,q(X)≪X1−δ for q = 2k obtained by the present method; a proof of the mean-value lemma used for moduli with an odd prime factor (Theorem 3.8 is imported); effective constants (every implied constant in a statement about Ra,q is ineffective, because Siegel–Walfisz enters); that the law of Yh is absolutely continuous; a joint limit law at more than the two shifts ±1; or that the digit-repulsion data persist at larger scales.

1.3. Relation to the Series

The restricted sum modulo 2k, the mean-square theorem, the transfer principle, the ternary theorem and the law of 𝔖0 along shifted primes were first posted in version 11 of [7] (9 October 2026, doi: 10.20944/preprints202604.0599.v11). The companion preprint [8] gives a self-contained treatment of the circle-method part, the limit law of 𝔖0(p + h) with enclosures of the moments Am(1) in ball arithmetic, and a computational study of the prime-generation graph p⊕q = p + q − 1. The almost-all theorem modulo a power of two was first announced in [9], and the empirical study of rays and gaps of consecutive primes is in [10]. The enclosures of Am(1) of [8] are consistent with Table 12 below.
Relation to the immediately preceding version. The immediate basis of the present version 13 is version 12 of [7] (posted 27 October 2026, doi: 10.20944/preprints202604.0599.v12), which is itself a revision of version 11. Version 12 already contains the corrected main term for arbitrary moduli (Section 3), the exact description of the zeros of the restricted sum for modulus 3 along consecutive primes (Theorem 7.3), the recurrence of the obstruction along pn + pn+d (Theorem 7.5), relative accuracy and the limit law of the restricted function along p + h (Corollary 6.7 and Theorem 11.13), the decomposition of the unrestricted error into restricted errors (Proposition 9.6), and the quaternary anchor and analogue (Proposition 10.4 and Proposition 11.18 of version 12). Relative to version 12, the following are new here: the Anchor–Helfgott existence theorem (Theorem 10.4, which is Proposition 10.4 of version 12 stated together with the non-existence for the primes 3, 5, 7) and the optimality of the anchor 3 (Proposition 10.5); the asymptotic formula for four primes with its singular series (Section 10.2); the joint limit law of the singular-series amplitudes at the shifts +1 and −1, with its negative dependence and certified limit correlation (Section 11.2), which settles for this pair of shifts the question left open as Open Question 12.12 of version 12; and the law of the four-prime count along shifted primes (Corollary 11.26). Where a statement here differs from its counterpart in version 12, the present version supersedes it.

1.4. Status Labels

Every statement carries one of [Proved], [Imported], [Cond. Proved (X)], [Comp. Verified], [Open], [Honest Caveat]. A [Comp. Verified] statement is a finite computation with its exact range; it is never a proof. An [Imported] statement is a result quoted from the literature, with its source named, whose proof is not reproduced here. A [Cond. Proved (X)] statement is proved under the named hypothesis X, which also appears in the statement itself.

1.5. Structure

Section 2 fixes notation and the numerical constants. Section 3 proves the local obstruction and gives the main term for arbitrary moduli. Section 4 computes the singular series of the progression modulo 2k and Section 5 proves the mean-square theorem. Section 6 contains the transfer principle and its consequences. Section 7 treats odd prime factors along consecutive primes, Section 8 the rays of consecutive primes, and Section 9 the second moment modulo q together with a numerical test of the main terms. Section 10 proves the ternary theorem and the quaternary results, and Section 11 the limit laws along shifted primes, including the joint law at the shifts ±1. Section 12 lists open questions and Section 13 concludes. Appendix A describes the computational protocol.

2. Notation and Fundamental Constants

Throughout, p,𝓁 denote primes, pn is the n-th prime (p1 = 2), e (x):=e2πix, Λ is the von Mangoldt function, φ Euler’s function, μ the Möbius function, τ = d the divisor function, ω(n) the number of distinct prime factors, and ‖x‖ the distance from x to the nearest integer. For 𝓁 > 2 put a𝓁:=(𝓁 − 1)/(𝓁 − 2). For X ≥ 3 put
S ( α ) = ∑ n ≤ X Λ ( n ) e   nα ,     S a , q ( α ) = ∑ n ≤ X n ≡ a   ( q ) Λ ( n ) e   nα ,     v ( β ) = ∑ 1 ≤ n ≤ X e   nβ .
The ray of a prime p modulo n is its residue class p mod n, and π(X;q,c)=#{p ≤ X:p≡c (q)}. We write gn = pn+1 − pn and Nn = pn + pn+1. For an odd prime 𝓁, c𝓁(N) = 𝓁 − 1 if 𝓁∣N and −1 otherwise; c r ( N ) = ∑ ( b , r ) = 1 e   bN / r is the Ramanujan sum. The exponential sums S, Sa,q and v defined in (3) are the basic objects of the circle method used in Section 4, Section 5 and Section 10: Lemma 4.3 writes Sa,q as a combination of shifts of S, Lemma 4.5 approximates S on the major arcs, and Theorem 4.2 bounds it on the minor arcs.
Definition 2.1
(Fundamental constants).  C 2 = ∏ l > 2 1 − ( l − 1 ) − 2 and G = ∏ l > 2 1 + ( l − 1 ) − 2
.
Proposition 2.2
(Certified constants).[Comp. Verified, partial products over all odd primes 𝓁 ≤ 2 × 107] One has C2 = 0.6601618… and G = 1.4132100…, each correct to the seven decimals shown. More precisely, the partial products over odd primes 𝓁 ≤ 2 × 107 are 0.660161817705… and 1.413209994556…, and C2 ∈ [0.66016181,0.66016182], G ∈ [1.41320999,1.41321001].
Proof. 
The partial products over the 1,270,606 odd primes 𝓁 ≤ P = 2 × 107 were computed in double precision. Every factor of the first product is below 1 and every factor of the second exceeds 1, so C2 ≤ C2(P) and G ≥ G(P). For the tails, Rosser and Schoenfeld [11] give π(t) < 1.25506 t/logt for t > 1, and partial summation gives ∑ l > P l − 2 ≤ 2 ∫ P ∞ π ( t ) t − 3 dt ≤ 2.51012 / ( P log P ) , whence ∑ l > P ( l − 1 ) − 2 ≤ ( 1 − 1 / P ) − 2 ⋅ 2.51012 / ( P log P ) < 7.5 × 10 − 9 (here PlogP > 3.36 × 108). Hence | log ∏ l > P ( 1 ± ( l − 1 ) − 2 ) | < 7.5 × 10 − 9 , so C 2 ≥ C 2 ( P ) e − 7.5 × 10 − 9 > 0.66016181 and G ≤ G ( P ) e 7.5 × 10 − 9 < 1.41321001 , which gives the stated enclosures.
Lemma 2.3
(Local factors). [Proved] For every odd prime 𝓁, 1 l − 1 < log a l ≤ 1 l − 2 ≤ 3 l , and loga𝓁 ≤ 2/𝓁 for 𝓁 ≥ 5. Consequently S 0 ( n ) m ≤ exp 3 m ∑ l ∣ n , l > 2 1 / l for every m > 0 and every integer n ≥ 1.
Proof. 
log a l = − log ( 1 − 1 l − 1 ) > 1 l − 1
and log a l = log ( 1 + 1 l − 2 ) ≤ 1 l − 2
. Moreover 𝓁/(𝓁 − 2) ≤ 3 for 𝓁 ≥ 3 and 𝓁/(𝓁 − 2) ≤ 2 for 𝓁 ≥ 4.

3. The Local Obstruction and the Main Term for General Moduli

Theorem 3.1
 (Local obstruction). [Proved] Let q ≥ 1, gcd(a,q) = 1, let 𝓁 be an odd prime dividing q, and let N be even with N≡a (mod 𝓁). Then every representation counted by Ra,q(N) has p2 = 𝓁, so R a , q N = ( log ( N − l ) ) ( log l ) , N − l is prime and N − l ≡ a   ( q ) , 0 , otherwise . In particular Ra,q(N) = Oq(logN) on a set of even integers of relative density 1/𝓁.
Proof. 
If N = p1 + p2 with p1≡a (q), then p1≡a (𝓁), and N≡a (𝓁) forces p2 = N − p1≡0 (𝓁). Since p2 is prime, p2 = 𝓁 and p1 = N − 𝓁; thus at most the ordered pair (N − 𝓁,𝓁) is counted. The conditions “N even” and “N≡a (𝓁)” define a single residue class modulo 2𝓁.
Corollary 3.2
(Positive density of unrepresentable integers).[Proved] Under the hypotheses of Theorem 3.1, #ℰa,q(X)≥⌊X/(2𝓁)⌋−π(X) − O(1). In particular Ra,q(N)∼Ma,q(N) cannot hold along all large even N: on the density-1/𝓁 set the left side is Oq(logN) while Ma,q(N) ≥ 2C2N/φ(q). No modulus divisible by an odd prime admits an almost-all theorem for the sum (2) with main term Ma,q.
Proof. 
By Theorem 3.1 each N ≤ X in the class with Ra,q(N) ≠ 0 has N − 𝓁 prime, which happens for at most π(X) values.
Remark 3.3 (Numerical illustration).
[Comp. Verified, even N≡1 (3), N ≤ 2000] For q = 3, a = 1, 𝓁 = 3 there are 333 even N ≤ 2000 with N≡1 (3), and 186 of them have R1,3(N) = 0.
Lemma 3.4
(No obstruction at q = 2k). [Proved] For q = 2k, gcd(a,q) = 1 and N even, gcd(N − a,q) = 1.
Proof. 
a is odd and N is even, so N − a is odd.
For an arbitrary modulus the obstruction is the only local defect, and the correct main term is the following.
Definition 3.5
(Main term for an arbitrary modulus). For q ≥ 1, gcd(a,q) = 1 and N even put S 0 ( m ) = ∏ p ∣ m ,   p > 2 p − 1 p − 2
and
M ~ a , q ( N ) : = 1 gcd ( N − a , q ) = 1   N φ ( q )   2 C 2   S 0 ( Nq ) ,
where the argument of 𝔖0 is the product Nq. For q = 2k this equals Ma,q(N) by Lemma 3.4, because 𝔖0(Nq) = 𝔖0(N).
Proposition 3.6
 (Two closed forms agree).[Proved] Write q = ∏ l e l , let εq = 2 if q is odd and εq = 1 otherwise, and set Δ l ( N ) = 1 l ∤ N − a   l − e l 1 − 1 l − 2   ( l ∣ q ,   l > 2 ) ,     Δ 2 ( N ) = 4 ⋅ 2 − e 2   ( 2 ∣ q ) , σ l ( N ) = 1 − ( l − 1 ) − 2 , l ∤ N , l / ( l − 1 ) , l ∣ N     ( l ∤ q ,   l > 2 ) . Then M ~ a , q ( N ) = ε q   N ∏ l ∣ q Δ l ( N ) ∏ l ∤ q ,   l > 2 σ l ( N ) .
Proof. 
Both sides vanish unless gcd(N − a,q) = 1; assume this. Compare local factors of 2C2𝔖0(Nq)/φ(q), using φ ( q ) = ∏ φ ( l e l ) and φ(𝓁e) = 𝓁e(1 − 1/𝓁). For 𝓁∤q, 𝓁 > 2: the factor of C2𝔖0(Nq) is 1 − (𝓁 − 1)−2 if 𝓁∤N, and ( 1 − ( l − 1 ) − 2 ) l − 1 l − 2 = l l − 1 if 𝓁∣N; this is σ𝓁(N). For 𝓁∣q, 𝓁 > 2: 𝔖0(Nq) contains l − 1 l − 2 whether or not 𝓁∣N, so the factor is
1 − 1 ( l − 1 ) 2 l − 1 l − 2 ⋅ 1 φ ( l e ) = l l − 1 ⋅ 1 l e ( 1 − 1 / l ) = l − e 1 − 1 l − 2 = Δ l ( N ) .
For 𝓁 = 2: if 2∣q the factor is 2/φ(2e) = 4 ⋅ 2−e = Δ2(N) (recall N − a is odd), with εq = 1; if q is odd the leftover factor 2 is εq.
Proposition 3.7
(Check of the two closed forms).[Comp. Verified, 1500 triples (q,a,N) with 1 ≤ q ≤ 60, gcd(a,q) = 1, N even <2 × 106, drawn with the fixed seed 20261019 (Appendix A); no exceptions] The expression of Definition 3.5 and the expression of Proposition 3.6 (evaluated by an explicit product over all odd primes ≤2 × 106, with C2 replaced by the same truncated product) agree with relative error at most 10−15 on the 1263 admissible triples, and both vanish on the remaining 237 triples, where gcd(N − a,q) > 1.
Theorem 3.8
(Mean-value lemma of Tolev).[Imported [12], Lemma 1] For k,l coprime, an interval I ⊆ [1,N] and n ≤ N put J k , l ( n ; I ) = ∑ p 1 + p 2 = n ,   p 1 ≡ l   ( k ) ,   p 1 ∈ I ( log p 1 ) ( log p 2 )
, Φ(n;I)=#{m1 + m2 = n:m1 ∈ I}, and 𝔖k,l(n) = 2C2𝔖0(nk) if (k,n − l) = 1 and 2∣n, 𝔖k,l(n) = 0 otherwise. For every A > 0 there is B = B(A) > 0 such that ∑ k ≤ N ( log N ) − B   max ( l , k ) = 1   max I ⊆ [ 1 , N ]   ∑ n ≤ N J k , l ( n ; I ) − S k , l ( n ) φ ( k ) Φ ( n ; I ) ≪ A N 2 ( log N ) − A .
Corollary 3.9
(General moduli: mean value and exceptional set).[Cond. Proved (Theorem 3.8)] Let q ≥ 1, gcd(a,q) = 1 and A > 0. Then ∑ N ≤ X N even R a , q ( N ) − M ~ a , q ( N ) ≪ A , q X 2 ( logX ) − A , { N ≤ X even : gcd ( N − a , q ) = 1 ,   R a , q ( N ) = 0 } ≪ A , q X ( logX ) − A . Consequently, up to OA,q(X(logX)−A) exceptions, every even N ≤ X with Ra,q(N) = 0 is non-admissible.
Proof. 
Take N = X, k = q (admissible in the sum once X is large), l = a and I = [1,X]; then Jq,a(n;I) = Ra,q(n) and Φ(n;I) = n − 1. Since M ~ a , q ( n ) = S q , a ( n )   n / φ ( q ) for even n, | M ~ a , q ( n ) − S q , a ( n ) ( n − 1 ) / φ ( q ) | ≪ q loglog n , which sums to Oq(XloglogX). This gives the first bound. For admissible even N ∈ (X/2,X] with Ra,q(N) = 0 we have | R a , q ( N ) − M ~ a , q ( N ) | = M ~ a , q ( N ) ≥ 2 C 2 N / φ ( q ) ≫ q X , so by Chebyshev there are ≪qX−1 ⋅ X2(logX)−A of them; summing over dyadic blocks gives the second bound.
Remark 3.10 (Scope for arbitrary moduli).
[Honest Caveat] (i) Tolev states that the proof of his Lemma 1 is obtained by inspection from the arguments of Mikawa[13] and Laporta[14] for twin primes in arithmetic progressions and does not write it out; Theorem 3.8 is imported at that level. (ii) For q = 2k Theorem 5.1 below is stronger (an L2 bound, with an exact evaluation of every arc coefficient) and Corollary 3.9 adds nothing there; the interest of Corollary 3.9 is that it covers every fixed q with the main term of Definition 3.5. (iii) The statement in Corollary 3.9 is an L1 statement with an ineffective constant; it is uniform in  q ≤ X ( log X ) − B only on average over k, as in Theorem 3.8. (iv) On the non-admissible N of Theorem 3.1 the sum Ra,q is O(logN), so for q with an odd factor the raw exceptional set has positive density, fully explained by the elementary obstruction; Proposition 9.8 below gives numerical evidence for the main term.
For the rest of the paper, unless stated otherwise, q = 2k with k ≥ 1 and a is odd.

4. The Singular Series for a Progression Modulo a Power of Two

4.1. Analytic Tools

Theorem 4.1
(Siegel–Walfisz).[Proved, classical [15]] For every B' > 0 there is c1 = c1(B') > 0 such that for r ≤ ( log t ) B ' and (c,r) = 1, ψ ( t ; r , c ) = t / φ ( r ) + O t   e − c 1 log t , where the implied constant depends on B' only and is ineffective.
Theorem 4.2
(Vaughan).[Proved, classical [15,16,17]] If (b,r) = 1 and |α − b/r| ≤ r−2, then ∑ n ≤ X Λ ( n ) e   nα ≪ X / r + X 4 / 5 + rX ( log X ) 4 with an absolute implied constant.
Lemma 4.3
(Restricted sum as a sum of shifts).[Proved] For q ≥ 1, S a , q ( α ) = 1 q ∑ h   mod   q e   − ah / q   S ( α + h / q ) . Consequently, for even N ≤ X, R a , q Λ ( N ) : = ∑ n 1 + n 2 = N n 1 ≡ a   ( q ) Λ ( n 1 ) Λ ( n 2 ) = ∫ 0 1 S a , q ( α ) S ( α ) e   − Nα   dα .
Proof. 
Insert 1 q ∑ h e   h ( n − a ) / q = 1 n ≡ a   ( q ) . The integral formula is orthogonality: for N ≤ X the constraint ni ≤ X is automatic.
Lemma 4.4
(Prime powers).[Proved] For 2 ≤ N ≤ X, | R a , q ( N ) − R a , q Λ ( N ) | ≪ X ( log X ) 2 .
Proof. 
The two sums differ only by pairs in which some ni is a proper prime power. There are O ( X ) proper prime powers up to X, each summand is at most (logX)2, and each such ni occurs in at most one pair.
Lemma 4.5
(Major-arc approximation).[Proved] Fix B' > 0. There is c = c(B') > 0 such that for r ' ≤ ( log X ) B ' , (b',r') = 1 and real β, S b ' r ' + β = μ ( r ' ) φ ( r ' )   v ( β ) + O X   e − c log X ( 1 + X | β | ) .
Proof. 
Terms with gcd(n,r') > 1 are prime powers of primes dividing r' and contribute O((logX)2). For a class c coprime to r' put ℰ(t) = ψ(t;r',c) − t/φ(r'). By Theorem 4.1 (with B' replaced by 2B' when t ≥ X , and trivially for t < X ), E ( t ) ≪ X e − c 2 log X uniformly for t ≤ X. Partial summation gives
∑ n ≤ X n ≡ c   ( r ' ) Λ ( n ) e   βn = 1 φ ( r ' ) ∫ 1 X e   βt   dt + O X e − c 2 log X ( 1 + X | β | ) ,
and ∫ 1 X e   βt dt = v ( β ) + O ( 1 + X | β | ) . Multiply by e (b'c/r') and sum over the φ ( r ' ) ≤ ( log X ) B ' classes, using ∑ ( c , r ' ) = 1 e   b ' c / r ' = μ ( r ' ) ; the factor φ(r') is absorbed by decreasing c.
Lemma 4.6
(Divisor and totient moments).[Proved, classical [18]] ∑ N ≤ X τ ( N ) 2 ≪ X ( log X ) 3 ; ∑ m ≤ y ( m / φ ( m ) ) 2 ≪ y , hence ∑ m ≤ y m / φ ( m ) 2 ≪ log ( y + 2 ) ; and ∑ m > z φ ( m ) − 2 ≪ min ( 1 , 1 / z ) for z > 0.
Proof. 
The first is classical. The other two follow by partial summation from ∑ m ≤ t ( m / φ ( m ) ) 2 ≪ t .

4.2. The Coefficients A(r,N)

Fix q = 2k, k ≥ 1, and a odd. For r ≥ 1, b coprime to r (with b = 0 if r = 1) and h mod q, let rb,h denote the denominator in lowest terms of b/r + h/q. Define
A ( r , N ) = 1 q ∑ h   mod   q e   − ah q ∑ b   mod   r ( b , r ) = 1 μ ( r ) μ ( r b , h ) φ ( r ) φ ( r b , h )   e   − Nb r .
In (4), A(r,N) is the coefficient attached to the denominator r: it arises from the major arcs around the fractions b/r (see the proof of Theorem 5.1), and the sum of these coefficients over r is the singular series of the restricted problem (Theorem 4.8). Proposition 4.7 below evaluates A(r,N) in closed form.
Proposition 4.7
(Factorisation of A(r,N)).[Proved] Let N be even and write r = r2r1 with r2 a power of 2 and r1 odd. Then A(r,N) = 0 unless r2 ∈ {1,2} and r1 is squarefree, and in that case A ( r , N ) = 2 q ⋅ μ 2 ( r 1 )   c r 1 ( N ) φ ( r 1 ) 2 .
Proof. 
If r is not squarefree, μ(r) = 0 and A(r,N) = 0. Assume r = r2r1 squarefree, so r2 ∈ {1,2}. Choose u,w with ur1 + wr2 = 1. Then b/r≡ub/r2 + wb/r1 (mod 1), and (b mod r2,b mod r1) runs over the product of the unit groups; gcd(w,r1) = 1 and, when r2 = 2, u is odd. The fraction wb/r1 has denominator r1 (odd), and ub/r2 + h/q has denominator dh, a power of 2; hence rb,h = dhr1, μ(rb,h) = μ(dh)μ(r1) and φ(rb,h) = φ(dh)φ(r1). Moreover e (−Nb/r) = e (−Nub/r2)e (−Nwb/r1), and the sum over units modulo r1 of the second factor is c r 1 ( Nw ) = c r 1 ( N ) . Therefore
A ( r , N ) = μ ( r 1 ) 2 c r 1 ( N ) φ ( r 1 ) 2 ⋅ F 2 ( r 2 ) ,     F 2 ( r 2 ) = 1 q ∑ h   mod   q e   − ah q μ ( r 2 ) μ ( d h ) φ ( r 2 ) φ ( d h ) e   − Nu b 2 r 2 ,
with b2 the unit class modulo r2.
Case r2 = 1. Here dh is the denominator of h/q, a power 2s, and μ(dh) = 0 unless s ≤ 1. The value s = 0 occurs for h = 0 (term 1), and s = 1 for h = q/2 (term e (−a/2)μ(2)/φ(2) = (−1)(−1) = 1, because a is odd). Hence F2(1) = 2/q.
Case r2 = 2. Here b2 = 1, u is odd and e (−Nu/2) = 1 because N is even. The fraction 1 2 + h q has denominator 2 for h = 0, denominator 1 for h = q/2, and denominator divisible by 4 otherwise. The two surviving terms are μ ( 2 ) φ ( 2 ) ⋅ μ ( 2 ) φ ( 2 ) = 1 for h = 0 and e   − a / 2 μ ( 2 ) φ ( 2 ) ⋅ 1 = 1 for h = q/2. Hence F2(2) = 2/q.
Theorem 4.8
(Singular series for the progression).[Proved] For every even N, ∑ r ≥ 1 A ( r , N ) converges absolutely and ∑ r ≥ 1 A ( r , N ) = 2 φ ( q ) C 2 S 0 ( N ) , so N ∑ r ≥ 1 A ( r , N ) = M a , q ( N ) .
Proof. By Proposition 4.7, ∑ r A ( r , N ) = ( F 2 ( 1 ) + F 2 ( 2 ) ) ∑ r 1 odd μ 2 ( r 1 ) c r 1 ( N ) / φ ( r 1 ) 2 , and F2(1) + F2(2) = 4/q = 2/φ(q). The odd sum is the Euler product
∏ l > 2 1 + c l ( N ) ( l − 1 ) 2 = ∏ l > 2 l ∤ N 1 − 1 ( l − 1 ) 2 ∏ l > 2 l ∣ N l l − 1 = C 2 ∏ l ∣ N l > 2 l − 1 l − 2 ,
using 𝓁/(𝓁 − 1) = (1 − (𝓁 − 1)−2) ⋅ (𝓁 − 1)/(𝓁 − 2). Absolute convergence follows from Lemma 4.9 below.
Lemma 4.9
(Tail and mean-square estimates for A(r,N)). [Proved] For even N ≥ 3 and y ≥ 2, with implied constants depending on q:
  • ∑ r > y | A ( r , N ) | ≪ y − 1 / 2 τ ( N ) loglog N ;
  • ∑ r ≤ y r | A ( r , N ) | ≪ τ ( N ) ( loglog N ) log y ;
  • ∑ r | A ( r , N ) | ≪ loglog N . .
Proof. 
By Proposition 4.7, | A ( r , N ) | ≤ 2 q μ ( r 1 ) 2 | c r 1 ( N ) | / φ ( r 1 ) 2 . For squarefree r1 and d = (r1,N) one has | c r 1 ( N ) | = φ ( d ) . Write r1 = dm with gcd(d,m) = 1 and use φ(dm) = φ(d)φ(m), so |A|≪1/(φ(d)φ(m)2). For (i), since r > y forces r1 > y/2,
∑ ≪ ∑ d ∣ N φ ( d ) − 1 ∑ m > y / ( 2 d ) φ ( m ) − 2 ≪ ∑ d ∣ N φ ( d ) − 1 min ( 1 , d / y ) ≤ y − 1 / 2 ∑ d ∣ N d 1 / 2 φ ( d ) ≪ y − 1 / 2 τ ( N ) loglog N
by Lemma 4.6 (for the sum over m) and because d1/2/φ(d) = d−1/2 ⋅ d/φ(d)≪loglogN for d∣N. For (ii), ∑ r 1 ≤ y r 1 / ( φ ( d ) φ ( m ) 2 ) ≤ ∑ d ∣ N d φ ( d ) ∑ m ≤ y / d m φ ( m ) 2 ≪ τ ( N ) ( loglog N ) log ( y + 2 ) . For (iii), ∑ r | A | ≪ ∏ l ∤ N ( 1 + ( l − 1 ) − 2 ) ∏ l ∣ N ( 1 + ( l − 1 ) − 1 ) ≪ G ⋅ N / φ ( N ) ≪ loglog N . (The passage from r1 to r ∈ {r1,2r1} costs a factor 2.)
Proposition 4.10
(Check of the factorisation).[Comp. Verified] For q ∈ {4,8,16}, every odd a < q (14 pairs (q,a)), N ∈ {2,4,6,10,12,30,42,90,210} and 1 ≤ r ≤ 60, that is 7560 combinations, the closed form of Proposition 4.7 agrees with the definition (4) (evaluated with exact rational denominators rb,h) to within 2 × 10−14; for q ∈ {32,64}, a ∈ {1,q − 1,q/2 + 1}, N ∈ {6,30,210} and 1 ≤ r ≤ 40 (720 combinations) the agreement is within 2 × 10−15; there were no exceptions.

5. The Mean-Square Theorem and the Exceptional Set

Theorem 5.1
(Mean-square theorem).[Proved] Let q = 2k with k ≥ 1, let a be odd and let A > 0. Then ∑ N ≤ X N even R a , q ( N ) − M a , q ( N ) 2 ≪ A , q X 3 ( log X ) − A . The implied constant is ineffective.
Proof. 
Let X be large and P = (logX)A+10. By Lemma 4.4, replacing Ra,q by R a , q Λ changes the sum by ≪X ⋅ X(logX)4, which is negligible.
Arcs. For 1 ≤ r ≤ P and (b,r) = 1 put 𝔐(r,b) = {α:|α − b/r| ≤ P/(rX)}, let 𝔐 be their union modulo 1 and 𝔪 = [0,1)\𝔐. For large X the arcs are pairwise disjoint because 2P/X < P−2, and |𝔐| ≤ 2P2/X. By Lemma 4.3, R a , q Λ ( N ) = J M ( N ) + J m ( N ) with J Ω ( N ) = ∫ Ω S a , q ( α ) S ( α ) e   − Nα dα .
Minor arcs. Let α ∈ 𝔪. By Dirichlet’s theorem with parameter X/P there are coprime b,r with r ≤ X/P and |α − b/r| ≤ P/(rX) ≤ r−2; since α ∉ 𝔐, r > P. Theorem 4.2 gives | S ( α ) | ≪ X ( log X ) 4 / P . The numbers J𝔪(N) are the Fourier coefficients of 1𝔪Sa,qS ∈ L2, so by Parseval and ∫ 0 1 | S a , q | 2 = ∑ n ≤ X , n ≡ a Λ ( n ) 2 ≪ X log X ,
∑ N | J m ( N ) | 2 = ∫ m | S a , q | 2 | S | 2 ≤ sup m | S | 2 ∫ 0 1 | S a , q | 2 ≪ X 3 ( log X ) 9 P .
Major arcs. Let α = b/r + β ∈ 𝔐(r,b), so |β| ≤ P/X. For each h mod q write b/r + h/q = b'/r' in lowest terms; then r' = rb,h ≤ rq ≤ qP ≤ (logX)A+11 for large X. Lemma 4.5 applied to S(α) and to S(α + h/q) gives S ( α ) = μ ( r ) φ ( r ) v ( β ) + O ( X e − c log X P ) and S ( α + h / q ) = μ ( r ' ) φ ( r ' ) v ( β ) + O ( X e − c log X P ) . Since |S|≪X, |v| ≤ X and |𝔐| ≤ 2P2/X, Lemma 4.3 yields
J M ( N ) = ∑ r ≤ P 1 q ∑ b   mod   r ( b , r ) = 1 ∑ h e   − ah q μ ( r ) μ ( r ' ) φ ( r ) φ ( r ' ) e   − Nb r I r ( N ) + O X P 3 e − c log X ,
where I r ( N ) = ∫ | β | ≤ P / ( rX ) v ( β ) 2 e   − Nβ dβ . Over a full period ∫ − 1 / 2 1 / 2 v 2 e   − Nβ dβ = N − 1 , and since |v(β)| ≤ (2∥β∥)−1, ∫ P / ( rX ) < | β | ≤ 1 / 2 | v | 2 ≤ rX / ( 2 P ) ; hence Ir(N) = N − 1 + θr rX/(2P) with |θr| ≤ 1. The double sum over b and h is exactly A(r,N) of (4). With Σ P ( N ) = ∑ r ≤ P A ( r , N ) ,
J M ( N ) = ( N − 1 ) Σ P ( N ) + O X P ∑ r ≤ P r | A ( r , N ) | + O X P 3 e − c log X .
By Theorem 4.8, N ∑ r A ( r , N ) = M a , q ( N ) , hence
J M ( N ) − M a , q ( N ) ≪ X ∑ r > P | A ( r , N ) | + ∑ r | A ( r , N ) | + X P ∑ r ≤ P r | A ( r , N ) | + X P 3 e − c log X .
Mean square. By Lemma 4.9 the first three terms of (6) are ≪ q X P − 1 / 2 τ ( N ) loglog X + loglog X + X P τ ( N ) ( loglog X ) log P . Squaring, summing over N ≤ X and using Lemma 4.6 gives ≪X3(logX)3(loglogX)2/P. Adding (5), the total is ≪X3(logX)9/P = X3(logX)−A−1, which proves the theorem. In summary, (5) is the minor-arc contribution to the mean square and (6) is the major-arc error term; together they give the stated bound.
Corollary 5.2
(Exceptional set).[Proved] For q = 2k, k ≥ 1, a odd and every A > 0, #ℰa,q(X)≪A,qX(logX)−A.
Proof. 
If N ∈ (X/2,X] is even and Ra,q(N) = 0, then |E(N)| = Ma,q(N) ≥ 2C2N/φ(q) ≥ C2X/φ(q) because 𝔖0(N) ≥ 1. By Theorem 5.1 (with A + 1 in place of A) and Chebyshev’s inequality the number of such N is ≪X3(logX)−A−1/X2. Summing over dyadic blocks X / 2 j > X , for which log ( X / 2 j ) ≥ 1 2 log X , and adding the trivial bound X for the rest gives the claim.
Corollary 5.3
(Relative accuracy).[Proved] For q = 2k, a odd and A,A' > 0, # { N ≤ X even : | R a , q ( N ) − M a , q ( N ) | > N ( log N ) − A } ≪ A , A ' , q X ( log X ) − A ' .
Proof. 
Apply Theorem 5.1 with A0 = 2A + A' on each dyadic block (Y/2,Y] with Y > X : the number of N in the block with |E(N)| > N(logN)−A ≥ (Y/2)(logY)−A is, by Chebyshev, ≪ Y 3 ( log Y ) − A 0 / Y 2 / 4 ( log Y ) − 2 A ≪ Y ( log Y ) − A ' . Sum over the blocks and add X for the remainder.
Remark 5.4.
[Honest Caveat] For q = 1 the corresponding result is the classical circle-method proof that almost all even integers are sums of two primes[2–4,16], and the exceptional set is O(X1−Δ) by Montgomery and Vaughan[5]. A power saving  # E a , q ( X ) ≪ X 1 − Δ q for q = 2k is not proved here (Open Question 12.1). The restriction q = 2k enters the proof only through Proposition 4.7: for an odd prime 𝓁∣q the shifts b/r + h/q change the odd part of rb,h and the coefficients no longer factor, and by Corollary 3.2 the conclusion fails.
Proposition 5.5
(Positivity and the binary Goldbach conjecture). [Proved] If Ra,q(N) > 0 then N is a sum of two primes. Hence finiteness of ℰa,q implies the binary Goldbach conjecture for all sufficiently large even N, and a bound |Ra,q(N) − Ma,q(N)| ≤ η(N)N with η(N) → 0 for every large even N would give Ra,q(N) > 0 for all large even N.
Proof. 
The first two statements are immediate from the definition. For the third, Ma,q(N) ≥ 2C2N/φ(q), so Ra,q(N) ≥ (2C2/φ(q) − η(N))N > 0 once η(N) < 2C2/φ(q).

6. Transfer to Consecutive Primes and Shifted Primes

Proposition 6.1
(Trivial representations).[Proved] If pn≡a (q) or pn+1≡a (q), then Ra,q(Nn) ≥ (logpn)(logpn+1) > 0.
Proof. 
If pn≡a, the pair (pn,pn+1) is counted; if pn+1≡a, so is (pn+1,pn).
Consequently the statements below carry content only for indices with pn≢a≢pn+1 (q).
Lemma 6.2
(Anchoring). [Proved] For n ≥ 2: Nn is even; Nn+1 − Nn = pn+2 − pn > 0, so n ↦ Nn is strictly increasing and injective; and Nn < 3pn. More generally, for fixed d ≥ 1 and Nn,d:=pn + pn+d, Nn,d is even for n ≥ 2, strictly increasing in n, and Nn,d < (1 + 2d)pn.
Proof. 
For n ≥ 2 both primes are odd. By Bertrand’s postulate [18], pn+1 < 2pn, hence gn < pn and Nn = 2pn + gn < 3pn; iterating, pn+d < 2dpn.
Theorem 6.3
(Transfer principle). [Proved] Let 𝒜 be a set, s:𝒜 → [1,∞) a size function, f:𝒜 → 2ℕ a map and ℬ ⊆ 2ℕ any set of even integers. Suppose that for constants m ≥ 1, κ ≥ 1, λ ≥ 0, #f−1(N) ≤ m for every N and f(n) ≤ κs(n) + λ for every n ∈ 𝒜. Then for all X ≥ 1, #{n ∈ 𝒜:s(n) ≤ X, f(n) ∈ ℬ} ≤ m⋅#(ℬ ∩ [1,κX + λ]). In particular, taking ℬ = ℰa,q, for every q ≥ 1 and gcd(a,q) = 1, #{n ∈ 𝒜:s(n) ≤ X, Ra,q(f(n)) = 0} ≤ m⋅#ℰa,q(κX + λ). The constants do not depend on any residue class of the elements of 𝒜.
Proof. 
For n in the left-hand set, f(n) ∈ ℬ and f(n) ≤ κX + λ, so f(n) ∈ ℬ ∩ [1,κX + λ], and each element has at most m preimages.
Corollary 6.4
(Consecutive primes, uniform in the ray).[Proved] For every c, every q,a and X ≥ 3, #{pn ≤ X:pn≡c (q), Ra,q(Nn) = 0}≤#ℰa,q(3X), and for d ≥ 1, #{pn ≤ X:pn≡c (q), Ra,q(pn + pn+d) = 0}≤#ℰa,q((1 + 2d)X).
Proof. 
Take 𝒜 = {n ≥ 2}, s(n) = pn, f(n) = Nn (respectively Nn,d), injective by Lemma 6.2, with m = 1, λ = 0 and κ = 3 (respectively 1 + 2d). Restricting to pn≡c (q) only shrinks the set.
Corollary 6.5
(Shifted primes).[Proved] For every odd integer h, every ℬ ⊆ 2ℕ and X ≥ 1, #{p ≤ X:p > max(|h|,2), p + h ∈ ℬ}≤#(ℬ ∩ [1,X + |h|]). In particular #{p ≤ X:p > max(|h|,2), Ra,q(p + h) = 0}≤#ℰa,q(X + |h|), uniformly over the rays of p modulo q.
Proof. 
For an odd prime p > |h| and odd h, p + h is even and positive, and p ↦ p + h is injective. Apply Theorem 6.3 with 𝒜 the primes p > max(|h|,2), s(p) = p, f(p) = p + h, m = κ = 1 and λ = |h|.
Corollary 6.6
(Almost-all statements).[Proved] Let q = 2k (k ≥ 1) and a odd. For every ray c with gcd(c,q) = 1 and every A > 0, #{pn ≤ X:pn≡c (q), Ra,q(Nn) = 0}≪A,qX(logX)−A = o(π(X;q,c)). Hence for almost all primes pn in every ray the even integer Nn = pn + pn+1 is a sum of two primes with first summand in the class a (q). The same holds for pn + pn+d with d fixed and for p + h with h odd fixed.
Proof. 
By Corollary 6.4 and Corollary 5.2 the left side is at most #ℰa,q(3X)≪X(logX)−A. Taking A = 2 and using π(X;q,c)∼X/(φ(q)logX) gives the o-statement. The other two statements follow in the same way from Corollary 6.4 and Corollary 6.5.
Corollary 6.7
(Shifted primes, relative accuracy).[Proved] Let q = 2k with k ≥ 1, a odd, h an odd integer and A,A' > 0. Then, for X ≥ max(|h|,3), # { p ≤ X : p > max ( | h | , 2 ) ,   | R a , q ( p + h ) − M a , q ( p + h ) | > ( p + h ) ( log ( p + h ) ) − A } ≪ A , A ' , q X ( log X ) − A '
, uniformly in the residue class of p modulo q, with an ineffective implied constant.
Proof. 
Let ℬ be the set of even N with |Ra,q(N) − Ma,q(N)| > N(logN)−A. By Corollary 6.5 the number of primes in question is at most #(ℬ ∩ [1,X + |h|]), which by Corollary 5.3 is ≪ A , A ' , q ( X + | h | ) ( log ( X + | h | ) ) − A ' ≪ X ( log X ) − A '
for X ≥ max(|h|,3).
Remark 6.8.
[Honest Caveat] (i) By Proposition 6.1 the conclusion for Nn is automatic when pn or pn+1 lies in the class a; for p + h no such trivial representation exists. (ii) The transfer inequality holds for every q, but for a modulus with an odd prime factor the exceptional set has positive density (Corollary 3.2), so Corollary 6.6 concerns q = 2k. (iii) None of this bears on the pointwise question whether Ra,q(Nn) > 0 for all large n, or Ra,q(p + h) > 0 for all large p. (iv) Shifted primes have density zero, so Corollary 5.2 alone is silent about them.
Proposition 6.9
(Brute-force checks). [Comp. Verified, R1,8 by FFT convolution in double precision; every nonzero value of R1,8(N) is at least log2 ⋅ log17 > 1.9, so values below 1/2 are exact zeros]
  • For q = 8, a = 1 and the first K primes, K ∈ {50,100,500,2000,5000}, the set of n ∈ [2,K] for which Nn has no representation with p1≡1 (8) gives the same values Nn ∈ {8,12,18,42,68} at every K; none of them has pn≡1 or pn+1≡1 (8), in accordance with Proposition 6.1.
  • For q = 8, a = 1 and all primes 11 ≤ p ≤ 6 × 106 − 20 (412,844 primes), the number of primes with R1,8(p + h) = 0 and the largest such p + h are as in Table 1; no exception occurs above 458. The exceptional set ℰ1,8(6 × 106) is {4,6,8,10,12,14,16,18,26,32,38,42,50,56,62,66,68,74,98,122,188,218,242,362,458}.
Remark 6.10.
[Honest Caveat] Corollary 6.6 is asymptotic; its numerical onset depends on the constants in Theorem 5.1, which are ineffective, and need not lie in the tested range. Proposition 6.9 tests only the stated finite ranges.

7. Moduli with an Odd Prime Factor Along Nn

Theorem 7.1 (Obstruction along consecutive primes).
[Proved] Let q have an odd prime factor𝓁, gcd(a,q) = 1, and n ≥ 2 with pn,pn+1 ≠𝓁. Write c≡pn and c'≡pn+1 modulo𝓁. If c + c'≡a (𝓁), then every representation counted by Ra,q(Nn) has p2 =𝓁, so Ra,q(Nn) = (log(Nn −𝓁))(log𝓁) if Nn −𝓁 is prime and Nn −𝓁≡a (q), and Ra,q(Nn) = 0 otherwise; in particular Ra,q(Nn) = Oq(logNn).
Proof. 
Nn≡c + c'≡a (𝓁); apply Theorem 3.1.
Corollary 7.2 (The obstructed set is infinite for
𝓵 = 3). [Proved] Let q = 3, a = 1. For pn > 3, Nn≡1 (3) if and only if pn≡pn+1≡2 (3), and there are infinitely many such n. Consequently R1,3(Nn) = O(logNn) for infinitely many n, and no asymptotic R1,3(Nn)≍Nn/φ(3) can hold along Nn.
Proof. 
For pn,pn+1 > 3 the residues are 1 or 2 modulo 3, and c + c'≡1 (3) only for c = c' = 2. Infinitely many pairs of consecutive primes lie in the class 2 modulo 3 by a theorem of Shiu on strings of consecutive primes in a residue class [19]. Apply Theorem 7.1.
Theorem 7.3 (Exact description for q
= 3, a = 1). [Proved] For every n ≥ 3 (that is, pn > 3), R1,3(Nn) = 0 if and only if pn≡pn+1≡2 (3) and Nn − 3 is composite. Equivalently, R1,3(Nn) = 0 if and only if Nn≡1 (3) and Nn − 3 is composite; and when pn≡pn+1≡2 (3) and Nn − 3 is prime, R1,3(Nn) = (log(Nn − 3))(log3).
Proof. 
If pn≡1 (3) or pn+1≡1 (3), then R1,3(Nn) > 0 by Proposition 6.1. Otherwise, since pn,pn+1 > 3, both are ≡2 (3), so Nn≡4≡1 (3), and by Corollary 7.2 this is the only configuration with Nn≡1 (3). Theorem 7.1 with 𝓁 = 3 and a = 1 now gives R1,3(Nn) = (log(Nn − 3))(log3) if Nn − 3 is prime and Nn − 3≡1 (3), and R1,3(Nn) = 0 otherwise. Since Nn≡1 (3) we have Nn − 3≡1 (3) automatically, and Nn − 3 ≥ 9; hence R1,3(Nn) = 0 exactly when Nn − 3 is composite.
Proposition 7.4 (Counts for q
= 3, a = 1). [Comp. Verified, all 216,813 pairs of consecutive primes with pn > 3 and Nn ≤ 6 × 106; R1,3 by FFT convolution; zero exceptions to Theorem 7.3] Among these pairs 46,122 (fraction 0.2127) have Nn≡1 (3) and 36,809 (fraction 0.1698) have R1,3(Nn) = 0; the remaining 9,313 pairs with Nn≡1 (3) have Nn − 3 prime. No index outside the class pn≡pn+1≡2 (3) has R1,3(Nn) = 0.
Theorem 7.5 (The local obstruction recurs infinitely often along the prime sequence).
[Proved] Let q ≥ 1 have an odd prime factor 𝓁, let gcd(a,q) = 1 and d ≥ 1. Then there are infinitely many n with Ra,q(pn + pn+d) = 0.
Proof. 
Let r be an odd prime with r∤q (so r ≠ 𝓁), and put Q = qr. By the Chinese remainder theorem choose c with
2 c ≡ a   ( mod   l ) ,     2 c ≡ l   ( mod   r ) ,     c ≡ 1   ( mod   l '   e ' )   for   every   other   prime   power   l '   e '   ∥   q ,
with c any unit modulo 𝓁e ∥ q lifting the first condition. Then gcd(c,Q) = 1: indeed gcd(a,𝓁) = 1, gcd(𝓁,r) = 1 and r,𝓁 are odd. By Shiu’s theorem on strings of congruent primes [19], for coprime c,Q and every m ≥ 1 there are infinitely many n with pn+1≡…≡pn+m≡c (mod Q). Taking m = d + 1 (and discarding the finitely many n with pn ≤ Q) we obtain infinitely many n with pn≡pn+d≡c (mod Q). For such n the integer N = pn + pn+d is even, satisfies N≡2c≡a (mod 𝓁), and satisfies N≡2c≡𝓁 (mod r). By Theorem 3.1, Ra,q(N) ≠ 0 forces N − 𝓁 to be prime; but r∣N − 𝓁 and N − 𝓁 > r, so N − 𝓁 is composite and Ra,q(N) = 0.
Remark 7.6.
[Honest Caveat] Theorem 7.5 shows that the conclusion of Corollary 6.4 for the sum Ra,q(pn + pn+d) cannot be extended to a modulus with an odd prime factor: along the prime sequence the exceptional set is then infinite. Theorem 7.5 is an existence statement; it carries no quantitative information on how often the obstruction occurs.
Proposition 7.7
(Numerical examples for Theorem 7.5). [Comp. Verified] For each row ofTable 2, the primes pn,pn+d are both congruent to the prescribed c modulo Q = qr, N = pn + pn+d satisfies N≡a (𝓁) and r∣N − 𝓁, and the defining sum Ra,q(N), evaluated directly over all primes p1 < N with p1≡a (q), equals 0. Each listed pair is the first pair with these properties among all primes below 107.
Remark 7.8.
[Honest Caveat] Along Nn the obstructed fraction for q = 3 is the joint frequency of the diagonal pair of rays (2,2) modulo 3, which by the Lemke Oliver–Soundararajan bias[20] is suppressed below 1/4 and, conditionally on the Hardy–Littlewood prime tuples conjecture, tends to 1/4 slowly; it is not the density 1/3 that the obstruction assigns to a generic even integer. The infinitude in Corollary 7.2 is proved; the density is not (Open Question 12.6). For other moduli with an odd prime factor the statement that every non-obstructed Nn has Ra,q(Nn) > 0 is not proved; Theorem 7.3 proves it for q = 3, a = 1, where a non-obstructed Nn always has a trivial representation.

8. Rays, Gaps and Digit Repulsion

For a prime p > 5 write ray(p) = p mod 10 ∈ {1,3,7,9} and ρn = ray(pn).
Proposition 8.1
(Surviving rays). [Proved] A residue class c (n) contains infinitely many primes if and only if gcd(c,n) = 1, and then π(X;n,c)∼φ(n)−1π(X).
Proof. 
If d = gcd(c,n) > 1, every integer ≡c (n) above d is composite. The converse and the asymptotics are Dirichlet’s theorem and the prime number theorem for arithmetic progressions [15].
Proposition 8.2
(Ray counts modulo 10).[Comp. Verified, sieve of Eratosthenes, all p ≤ 108; zero exceptions] π(108) = 5,761,455; exactly 5,761,453 of these primes lie in a ray {1,3,7,9} (the prime 3 being counted in ray 3) and the other two are 2 and 5. Table 3 lists the counts at six scales; at X = 108 each count is within 0.02% of π(X)/4.
Proposition 8.3
(Digit repulsion). [Comp. Verified, all 5,761,451 pairs of consecutive primes >5 and ≤108]Table 4gives ℙ(ρn+1 = b∣ρn = a). The diagonal is suppressed to between 16.7% and 17.7% against 25% under independence and every off-diagonal entry exceeds 20.8%; the qualitative bias of[20] is reproduced with 5.76 million primes, at about 1/17 of the scale of the original data set of[20].
Proposition 8.4
(Ray–gap identity). [Proved] For pn > 5, gn≡ρn+1 − ρn (mod 10). In particular ρn+1 = ρn if and only if 10∣gn, and then gn ≥ 10; the ray of pn+1 is determined by ρn and gn mod 10, and conversely.
Proof. 
gn = pn+1 − pn reduces modulo 10 to ρn+1 − ρn; if ρn+1 = ρn then 10∣gn > 0.
Proposition 8.5
(Repetition of the ray by the size of the gap). [Comp. Verified, all consecutive primes 5 < pn < pn+1 ≤ 108]Table 5gives, for six classes of gap size, the share of all gaps and the proportion of those gaps that return to the same ray. The gaps 2,4,6,8 make up 34.4% of all gaps and none can return; overall 17.18% of the gaps are multiples of 10, against 20% if the five even residues of gn modulo 10 were equally likely.
Remark 8.6.
[Honest Caveat] The preceding proposition displays the arithmetic part of the repulsion: more than a third of all gaps are too short to return to the ray. It does not prove that this accounts for the whole bias, nor does it replace the mechanism of Lemke Oliver and Soundararajan[20], which concerns correlations between gap sizes and rests on the Hardy–Littlewood prime tuples conjecture.
Proposition 8.7
(Joint frequencies modulo 3). [Comp. Verified, consecutive primes 3 < pn < pn+1 ≤ N]Table 6gives the joint frequency of (pn mod 3,pn+1 mod 3); the diagonal cells increase and the off-diagonal cells decrease towards 25% as N grows through the three scales tested (monotonicity is not proved).
Proposition 8.8
(Out-of-sample prediction of the next ray). [Comp. Verified; recipe fixed before the run; temporal split of the pairs 5 < pn < pn+1 ≤ 108: training pn ≤ 5 × 107 (3,001,131 pairs), test pn > 5 × 107 (2,760,320 pairs)] For the context (ρn,ρn−1,…,ρn−k+1) the predictor of ρn+1 is the most frequent next ray in the training set. On the test set the accuracy is 0.3111,0.3152,0.3158,0.3160 for k = 1,2,3,4, against the baseline 0.2500 (standard error 0.0003).
Remark 8.9.
[Honest Caveat] Essentially all of the excess over 0.25 comes from the last ray: the gain from k = 1 to k = 4 is 0.005 in accuracy, in line with the decay of the probability that ray(pn+j) = ray(pn) with the lag j. The accuracy of about 31.6% is a measurement of the Lemke Oliver–Soundararajan bias as a predictor, not a new mechanism, and is not asserted to persist at larger scales, where the bias decays.

9. The Second Moment Modulo q and a Numerical Test of the Main Terms

Let q = 2k and Da,q(N):=(Ra,q(N) − Ma,q(N))/Ma,q(N).
Proposition 9.1
(Symmetry of the restricted sum).[Proved] For classes a,a'modulo q let R a , a ' ( N ) = ∑ p 1 + p 2 = N ,   p 1 ≡ a ,   p 2 ≡ a ' ( log p 1 ) ( log p 2 ) . Then R a , a ' ( N ) = R a ' , a ( N ) . In particular, for N≡2a (q) the representations counted by Ra,q(N) are closed under (p1,p2) ↦ (p2,p1), and R a , q ( N ) = 2 ∑ p 1 < p 2 ,   p 1 + p 2 = N ,   p 1 ≡ a ( log p 1 ) ( log p 2 ) + 1 N / 2 prime ,   N / 2 ≡ a   ( q ) ( log N / 2 ) 2 , whereas for N≢2a (q) each unordered pair {p,p'} with p≡a and p'≡N − a≢a is counted exactly once.
Proof. 
Exchange p1,p2 in the defining sum. If N≡2a then p1≡a implies p2 = N − p1≡a, so both orders are counted, and the term p1 = p2 = N/2 is counted once. If N≢2a the class of p2 differs from that of p1, and only one order of an unordered pair is counted.
Remark 9.2 (Heuristic consequence).
[Honest Caveat] If the counts of unordered pairs fluctuated like independent Poisson variables and the sum itself had the same mean μ in every class, the doubling in Proposition 9.1 (each unordered pair being counted twice when N≡2a (q), so that the number of pairs has mean μ/2) would multiply the variance of Ra,q(N) by 4(μ/2)/μ = 2 when N≡2a (q). This is a heuristic explanation of the numerical ratio below, not a proof.
Proposition 9.3
(Variance ratio on the class N≡2a (q)). [Comp. Verified; Ra,q(N) by FFT convolution of the weighted prime indicators for all even N ≤ 6 × 106, Ma,q from an exact factorisation sieve; even N ∈ [106,6 × 106]] Let ρa,q be the mean of D a , q 2 on N≡2a (q) divided by its mean on the other even classes. For q = 8 and a = 1,3,5,7: 2.44,2.01,2.04,2.03. For q = 16 and a = 1,3,…,15: 2.06,2.07,2.04,2.00,2.18,2.08,2.08,2.06 (mean 2.07). For q = 32 and all sixteen odd a the mean is 2.04 and the range is 1.94 to 2.21.
Proposition 9.4
(Size of the second moment).[Comp. Verified; q = 8, a = 1, all even N ≤ X, X ≤ 6 × 106] Table 7 gives ∑ N ≤ X ( R 1 , 8 ( N ) − M 1 , 8 ( N ) ) 2
relative to X3 and to X3/logX. The second ratio decreases monotonically in X, from 4.68 × 10−4 at X = 2 × 105 to 3.19 × 10−5 at X = 6 × 106. Between these two values of X the second moment itself grows like Xγ with γ = log(ratio of the sums)/log30≈2.14.
Remark 9.5.
[Honest Caveat] The preceding proposition is a finite-range measurement. It is consistent with Theorem 5.1, which implies ∑ N ≤ X E ( N ) 2 / ( X 3 / log X ) → 0 for q = 2k, but it proves nothing about the limit or about the rate beyond the tested range; in particular the exponent 2.14 is a local slope over one decade and a half, not an asymptotic exponent.
Proposition 9.6
(The unrestricted error as a sum of restricted errors).[Proved] Let q = 2k (k ≥ 1), let N ≥ 4 be even, and let R(N) be as in (1), D(N):=R(N) − 2C2𝔖0(N)N and R2(N):=(log2)(log(N − 2))1N−2 prime. Then
  • ∑ a odd   ( q ) R a , q N = R N − R 2 N  and ∑ a odd   ( q ) M a , q N = 2 C 2 S 0 N N ; hence ∑ a odd   ( q ) ( R a , q ( N ) − M a , q ( N ) ) = D ( N ) − R 2 ( N ) , and D(N) depends on N alone, not on q or a;
  • ( D ( N ) − R 2 ( N ) ) 2 ≤ φ ( q ) ∑ a ( R a , q ( N ) − M a , q ( N ) ) 2 ;
  • ∑ N ≤ X D ( N ) 2 ≤ 2 φ ( q ) ∑ a ∑ N ≤ X ( R a , q ( N ) − M a , q ( N ) ) 2 + O ( X ( log X ) 3 ) .
Proof. 
(i) Every prime summand other than 2 lies in exactly one odd class modulo q; the only pairs not counted in ∑ a R a , q are those with p1 = 2, which contribute R2(N). There are φ(q) = q/2 odd classes and Ma,q has the factor 2C2/φ(q), so the main terms add up to 2C2𝔖0(N)N. (ii) is the Cauchy–Schwarz inequality over the φ(q) classes. (iii) Since D 2 ≤ 2 ( D − R 2 ) 2 + 2 R 2 2 and ∑ N ≤ X R 2 ( N ) 2 ≤ ( log X ) 4 π ( X ) ≪ X ( log X ) 3 , the claim follows from (ii).
Remark 9.7.
[Honest Caveat] By Proposition 9.6(iii), Theorem 5.1 for all odd a recovers the classical mean-square estimate for the unrestricted error ∑ D ( N ) 2 , and, conversely, any lower bound for ∑ N ≤ X D ( N ) 2 gives a lower bound ∑ a ∑ N E a , q ( N ) 2 ≥ 1 2 φ ( q ) ∑ N D ( N ) 2 − O ( X ( log X ) 3 ) for the restricted second moments, where Ea,q(N) = Ra,q(N) − Ma,q(N). This is an exact identity of the arithmetic functions involved; it does not by itself locate the true order of ∑ N D ( N ) 2 (Open Question 12.9).
Proposition 9.8
(Main term for q = 2k and for general moduli). [Comp. Verified, all even N ∈ [106,2 × 106], Ra,q by FFT convolution, M ~ a , q from Definition 3.5 with C2 = 0.6601618158…] In every case below Ra,q(N) > 0 for all admissible N in the range (zero failures). Table 8 gives the ratio Ra,q/Ma,q for q = 2k over the 500,001 even N of the range. Table 9 gives, for moduli with an odd factor, the ratio R a , q / M ~ a , q on the admissible N (gcd(N − a,q) = 1), together with the largest value of Ra,q(N) on the non-admissible even N of the range; this largest value is 15.94 = (log(N − 3))(log3) when only 𝓁 = 3 obstructs and 23.35 = (log(N − 5))(log5) when 𝓁 = 5 also obstructs, as Theorem 3.1 predicts, and is O(logN) in every case.

10. The Restricted Ternary Problem and the Four-Prime Results

For odd n put W a , q ( n ) = ∑ p 1 + p 2 + p 3 = n ,   p 1 ≡ a   ( q ) ( log p 1 ) ( log p 2 ) ( log p 3 ) and
S 3 ( n ) = 2 ∏ l ∣ n l > 2 1 − 1 ( l − 1 ) 2 ∏ l ∤ n l > 2 1 + 1 ( l − 1 ) 3 .
Theorem 10.1
(Vinogradov’s theorem with a prime in a class modulo 2k). [Proved] Let q = 2k (k ≥ 1), a odd and A > 0. For odd n, W a , q ( n ) = S 3 ( n ) 2 φ ( q ) n 2 + O A , q n 2 ( log n ) − A . The implied constant is ineffective.
Proof. 
Take X = n and P = (logn)2A+10 with the arcs of the proof of Theorem 5.1. As in Lemmas 4.3 and 4.4, W a , q Λ ( n ) = ∫ 0 1 S a , q S 2 e   − nα dα and |W − WΛ|≪n3/2(logn)3.
Minor arcs. By Theorem 4.2 and Cauchy–Schwarz,
∫ m S a , q S 2 e   − nα dα ≤ sup m | S | ∫ 0 1 | S a , q | 2 1 / 2 ∫ 0 1 | S | 2 1 / 2 ≪ n ( log n ) 4 P ⋅ n log n ≪ n 2 ( log n ) − A .
Major arcs. With α = b/r + β and Lemma 4.5, the integrand equals 1 q ∑ h e   − ah / q μ ( r ' ) μ ( r ) 2 φ ( r ' ) φ ( r ) 2 v ( β ) 3 up to O ( n 3 e − c log n P ) pointwise, contributing O ( n 2 P 3 e − c log n ) in total. Set
A 3 ( r , n ) = 1 q ∑ h e   − ah q ∑ ( b , r ) = 1 μ ( r b , h ) μ ( r ) 2 φ ( r b , h ) φ ( r ) 2 e   − nb r .
Exactly as in Proposition 4.7 (the odd part contributes μ ( r 1 ) 3 c r 1 ( n ) / φ ( r 1 ) 3 = μ ( r 1 ) c r 1 ( n ) / φ ( r 1 ) 3 ; for the 2-part, when r2 = 2 one now has e (−nub2/2) = −1 because n is odd, and this sign combines with the signs of μ and e (−a/2) to give again +2/q in each of the cases r2 = 1,2) one finds A 3 ( r , n ) = 2 q μ ( r 1 ) c r 1 ( n ) / φ ( r 1 ) 3 for r2 ∈ {1,2} and r1 odd squarefree, and A3(r,n) = 0 otherwise. Hence
∑ r ≥ 1 A 3 ( r , n ) = 4 q ∏ l > 2 1 − c l ( n ) ( l − 1 ) 3 = S 3 ( n ) φ ( q ) ,
since 𝓁∤n gives 1 + (𝓁 − 1)−3 and 𝓁∣n gives 1 − (𝓁 − 1)−2. On 𝔐(r,b), ∫ | β | ≤ P / ( rn ) v 3 e   − nβ dβ = n − 1 2 + O ( ( rn / P ) 2 ) , because the full-period integral counts the triples n1 + n2 + n3 = n and |v(β)|3 ≤ (2∥β∥)−3 bounds the tail. Therefore
J M ( n ) = n − 1 2 ∑ r ≤ P A 3 ( r , n ) + O n 2 P 2 ∑ r ≤ P r 2 | A 3 ( r , n ) | + O n 2 P 3 e − c log n .
Since | A 3 ( r , n ) | ≤ 2 q | c r 1 ( n ) | φ ( r 1 ) − 3 ≤ 2 q φ ( r 1 ) − 2 , Lemma 4.6 gives ∑ r ≤ P r 2 | A 3 | ≪ P and ∑ r > P | A 3 | ≪ ∑ r 1 > P / 2 φ ( r 1 ) − 2 ≪ 1 / P , so the error terms are ≪n2/P≪n2(logn)−A. As n − 1 2 ∑ r A 3 = S 3 ( n ) 2 φ ( q ) n 2 + O ( n ) , the theorem follows.
Corollary 10.2
(Positivity).[Proved] For q = 2k and odd a there is n0(q) such that every odd n ≥ n0(q) is a sum p1 + p2 + p3 of primes with p1≡a (q); more precisely W a , q ( n ) ≥ C 2 φ ( q ) n 2 ( 1 + o ( 1 ) ) .
Proof. 
For odd n, S 3 ( n ) ≥ 2 ∏ l > 2 ( 1 − ( l − 1 ) − 2 ) = 2 C 2
: every factor with 𝓁∤n exceeds 1 and every factor with 𝓁∣n equals the corresponding factor of C2.
Remark 10.3 (Anchoring at p
3 = 3). [Proved] For odd n ≥ 9, Wa,q(n) ≥ (log3)Ra,q(n − 3), since all terms are nonnegative and one may restrict to p3 = 3 (the sum Ra,q(n − 3) has n − 3 even). Together with Corollary 5.2 this gives positivity of Wa,q(n) for almost all odd n at once; Theorem 10.1 supersedes it, since it gives positivity for every large odd n.

10.1. The Anchor 3 and the Representation of p + 1 by Four Primes

Theorem 10.4
(Anchor–Helfgott existence). [Proved, using Helfgott’s theorem[21]] For every prime p > 7 there exist primes q2,q3,q4 with p + 1 = 3 + q2 + q3 + q4. For p ∈ {3,5,7} no such representation exists.
Proof. 
Since p > 7 is prime, p is odd and m:=p − 2 is odd with m > 5. By Helfgott’s theorem[21], every odd integer exceeding 5 is a sum of three primes, so m = q2 + q3 + q4 for some primes q2,q3,q4, i.e. p + 1 = 3 + q2 + q3 + q4. For p ∈ {3,5,7} one has p − 2 ∈ {1,3,5}, and a sum of three primes is at least 6 and, if odd, at least 7. [Comparison with the preceding version] This statement is Proposition 10.4 of version 12 of[7], where the threshold p > 7 was given as sharp only for this argument and the non-existence for p in {3,5,7} was not stated; the optimality of the anchor 3 (Proposition 10.5) is new.
Proposition 10.5
(Optimality of the anchor 3). [Proved, using Helfgott’s theorem [21]] Let p be an odd prime.
  • For the anchor 2: p + 1 = 2 + q2 + q3 + q4 with primes qi holds if and only if p − 3 is a sum of two primes. In particular the case of the anchor 2 is, for every p, an instance of the binary Goldbach problem for the even integer p − 3.
  • For an odd prime anchor a: p + 1 = a + q2 + q3 + q4 with primes qi holds if and only if p ≥ a + 6.
Consequently the anchor 3 serves every prime p > 7, no odd prime anchor serves a larger set of primes, and the anchors 3 and 5 serve exactly the same primes (p ≥ 11), while for every prime anchor a ≥ 7 the set served is strictly smaller.
Proof. 
(i) The integer m = p − 1 is even. Three odd primes have an odd sum, so some qi = 2, and the remaining two primes sum to m − 2 = p − 3; conversely, if p − 3 = s + t with primes s,t, then p + 1 = 2 + 2 + s + t. (ii) For odd a and odd p, m = p + 1 − a is odd. If m ≥ 7, Helfgott’s theorem writes m as a sum of three primes; if m∈ {1,3,5}, no representation exists, because a sum of three primes is at least 6 and, if odd, at least 7. Thus the representation exists if and only if p + 1 − a ≥ 7. For a = 3 this is p ≥ 9, that is p ≥ 11 among primes, and for a = 5 it is p ≥ 11; for a prime a ≥ 7 the prime p = 11 is excluded since a + 6 ≥ 13.

10.2. An Asymptotic Formula for Four Primes

For an even integer N put
r 4 ( N ) : = ∑ p 1 + p 2 + p 3 + p 4 = N ( log p 1 ) ( log p 2 ) ( log p 3 ) ( log p 4 ) ,     S 4 ( N ) : = ∏ l 1 + c l ( N ) φ ( l ) 4 ,
where c𝓁(N) = c𝓁(N) is the Ramanujan sum modulo the prime 𝓁 (so c2(N) = 1 for even N). Then
S 4 ( N ) = 2 C 4   S 4 ∘ ( N ) ,     C 4 : = ∏ l > 2 1 − 1 ( l − 1 ) 4 ,     S 4 ∘ ( N ) : = ∏ l ∣ N l > 2 a l ( 4 ) ,
with a l ( 4 ) : = 1 + ( l − 1 ) − 3 1 − ( l − 1 ) − 4 = 1 + 1 ( l − 2 ) ( l 2 − 2 l + 2 ) , because the local factor is 1 − (𝓁 − 1)−4 if 𝓁∤N and 1 + (𝓁 − 1)−3 if 𝓁∣N, and 2 at 𝓁 = 2. Thus (7) splits S4(N) into the constant 2C4 and the factor S4∘(N), which depends on N only through its odd prime divisors; this is the form used in Proposition 10.7 and in Corollary 11.26.
Theorem 10.6
(Asymptotic formula for four primes).[Proved] Let A > 0. For every even N ≥ 4, r 4 ( N ) = S 4 ( N ) N 3 6 + O A N 3 ( log N ) − A , with an ineffective implied constant.
Proof. 
Take X = N and P = (logN)A+10, with the arcs 𝔐(r,b) and 𝔪 of the proof of Theorem 5.1. As in Lemma 4.4, r 4 ( N ) − r 4 Λ ( N ) ≪ N 5 / 2 ( log N ) 4
(a proper prime power can occupy any of four places, and the other three variables determine the fourth), where r 4 Λ ( N ) = ∫ 0 1 S ( α ) 4 e   − Nα dα
.
Minor arcs. For α ∈ 𝔪, Theorem 4.2 gives |S(α)|≪N(logN)4P−1/2, and ∫ 0 1 | S | 2 = ∑ n ≤ N Λ ( n ) 2 ≪ N log N . Hence
∫ m S 4 e   − Nα dα ≤ sup m | S | 2 ∫ 0 1 | S | 2 ≪ N 3 ( log N ) 9 P = N 3 ( log N ) − A − 1 .
Major arcs. Let α = b/r + β ∈ 𝔐(r,b), r ≤ P ≤ (logN)A+10, |β| ≤ P/(rN). By Lemma 4.5, S ( α ) = μ ( r ) φ ( r ) v ( β ) + O ( N e − c log N P ) ; since |S|,|v|≪N,
S ( α ) 4 = μ ( r ) 2 φ ( r ) 4 v ( β ) 4 + O N 4 P e − c log N ,
and |𝔐| ≤ 2P2/N. Summing over b with ∑ ( b , r ) = 1 e   − Nb / r = c r ( N ) ,
∫ M S 4 e   − Nα dα = ∑ r ≤ P A 4 ( r , N )   I r ( N ) + O N 3 P 3 e − c log N ,   A 4 ( r , N ) : = μ 2 ( r ) c r ( N ) φ ( r ) 4 ,
with I r ( N ) = ∫ | β | ≤ P / ( rN ) v ( β ) 4 e   − Nβ dβ . Over a full period the integral counts the quadruples n1+…+n4 = N with ni ≥ 1, namely N − 1 3 = N 3 / 6 + O ( N 2 ) (the condition ni ≤ N is automatic), and since |v(β)| ≤ (2∥β∥)−1, ∫ | β | > γ | v | 4 ≤ γ − 3 / 24 ; hence I r ( N ) = N − 1 3 + θ r   ( rN / P ) 3 / 24 with |θr| ≤ 1. For squarefree r, |cr(N)| ≤ φ(r), so |A4(r,N)| ≤ φ(r)−3, and with r/φ(r)≪loglogP,
∑ r ≤ P r 3 | A 4 ( r , N ) | ≪ ∑ r ≤ P r φ ( r ) 3 ≪ P ( loglog P ) 3 ,     ∑ r > P | A 4 ( r , N ) | ≤ ∑ r > P φ ( r ) − 2 ≪ 1 P
by Lemma 4.6. Therefore ∫ M S 4 e   − Nα dα = N − 1 3 ∑ r ≥ 1 A 4 ( r , N ) + O ( N 3 P − 2 ( loglog P ) 3 + N 3 P − 1 ) + O ( N 3 P 3 e − c log N ) . The function r ↦ A4(r,N) is multiplicative, supported on squarefree r, with A4(𝓁,N) = c𝓁(N)/φ(𝓁)4 and ∑ r | A 4 ( r , N ) | ≤ ∏ l ( 1 + φ ( l ) − 3 ) < ∞ , so ∑ r ≥ 1 A 4 ( r , N ) = S 4 ( N ) and 𝔖4(N)≪1. Collecting the pieces and N − 1 3 = N 3 / 6 + O ( N 2 ) proves the theorem.
Proposition 10.7
(Size of 𝕾4). [Comp. Verified, partial product over all odd primes 𝓁 ≤ 3 × 106; tail <10−19] C4 = 0.93294727…, so 2C4 ∈ [1.8658945,1.8658946], and for every even N, 2 C 4 ≤ S 4 ( N ) ≤ 2 C 4 ∏ l > 2 a l ( 4 ) < 2.3010
, where ∏ l > 2 a l ( 4 ) = 1.2331680 …
(Proposition 11.25).
Proof. 
The tail of the product defining C4 beyond P = 3 × 106 is bounded by ∑ n > P ( n − 1 ) − 4 < 1 / ( 3 ( P − 1 ) 3 ) < 10 − 19 . The lower bound follows from a l ( 4 ) > 1 and the upper bound from S 4 ∘ ( N ) ≤ ∏ l > 2 a l ( 4 ) .
Corollary 10.8
(Representation by four primes).[Proved] There is N0such that for every even N ≥ N0, r 4 ( N ) ≥ ( 1.8658 ) N 3 6 ( 1 + o ( 1 ) ) > 0 ; in particular every even N ≥ N0, and hence p + 1 for every prime p ≥ N0, is a sum of four primes.
Proof. 
Theorem 10.6 with A = 1 and Proposition 10.7.
Proposition 10.9
(Numerical check of Theorem 10.6). [Comp. Verified, r4(N) by FFT convolution of the log-weighted prime indicator (including the prime 2), all even N ≤ 2 × 105; 𝔖4 from (7) with C4 as in Proposition 10.7]Table 10gives 𝔖4(p + 1) for the odd primes p ≤ 31.Table 11gives, over all even N in three windows, the statistics of r4(N)/(𝔖4(N)N3/6); the means increase towards 1.
Remark 10.10.
[Honest Caveat] 𝔖4(N) is the singular series of the four-prime problem and is bounded between 2C4 and 2.3010; it is not to be confused with the moments  A m ( h ) = E [ Y h m ] ofSection 11, which describe averages of the odd part𝔖0 over shifted primes. Theorem 10.6 is a pointwise asymptotic formula for every even N, in contrast with the binary problem; it gives no information on the representation of p + 1 with the anchor 3 (Theorem 10.4), which is an existence statement. Both statements are unconditional; the implied constant in Theorem 10.6 is ineffective because Siegel–Walfisz enters.

11. The Law of the Singular Series Along Shifted Primes

11.1. The Law Along p + h

Fix an integer h ≠ 0. Let (B𝓁)𝓁>2, 𝓁∤h be independent Bernoulli variables with ℙ(B𝓁 = 1) = 1/(𝓁 − 1) and define
Y h = ∏ l > 2 l ∤ h a l B l ,     M h ( z ) = E   Y h z ,     A m ( h ) = M h ( m ) .
The choice ℙ(B𝓁 = 1) = 1/(𝓁 − 1) is the density of primes p with 𝓁∣p + h when 𝓁∤h; the primes 𝓁∣h are omitted because 𝓁∣p + h forces p = 𝓁. Throughout this section p ranges over primes p > |h|, so that p + h > 0, and ℙx,𝔼x refer to p uniform among the primes |h| < p ≤ x. Equation (8) thus defines the random Euler product Yh that appears as the limit law of S0(p+h) in Theorem 11.3, together with its moment function Mh(z) and the moments Am(h) of Theorem 11.5 and Table 12.
Proposition 11.1
(The model).[Proved] (i) Yh is almost surely finite and Yh > 1 almost surely. (ii) For every complex z the product M h ( z ) = ∏ l > 2 ,   l ∤ h 1 + a l z − 1 l − 1 converges and Mh is entire of order at most 1. (iii) M h ( z ) = M 1 ( z ) ∏ l ∣ h ,   l > 2 1 + a l z − 1 l − 1 − 1 .
Proof. 
(i) E log Y h = ∑ l log a l l − 1 < ∞ since loga𝓁 ≤ 1/(𝓁 − 2), so logYh < ∞ a.s. Also P ( Y h = 1 ) = P ( B l = 0   ∀ l ) = ∏ ( 1 − 1 l − 1 ) = 0 because ∑ 1 / l = ∞ . (ii) By Theorem 11.8(1) below, E Y h s < ∞ for every real s, hence max ( 1 , Y h Re   z ) ∈ L 1 ; dominated convergence applied to the partial products ∏ l ≤ L a l z B l (dominated in modulus by max ( 1 , Y h Re   z ) ) and independence give the product formula and analyticity. The bound |Mh(z)| ≤ Mh(Re z) ≤ exp(|z|log|z| + O(|z|)) shows order at most 1. (iii) is immediate.
Lemma 11.2
(Divisibility of shifted primes).[Proved] Fix an integer h ≠ 0 and put x' = x + |h|. There is x0(h) such that for x ≥ x0 and every odd squarefree d ≤ x ' : ℙx(d∣p + h) ≤ 5/φ(d) if gcd(d,h) = 1, and ℙx(d∣p + h) = 0 if gcd(d,h) > 1.
Proof. 
If 𝓁∣d and 𝓁∣h, then 𝓁∣p + h forces 𝓁∣p, i.e. p = 𝓁 ≤ |h|, which is excluded. If gcd(d,h) = 1, then d∣p + h means p≡−h (d), a unit class, and the Brun–Titchmarsh inequality in the form of Montgomery and Vaughan [22], π(x;d,c) ≤ 2x/(φ(d)log(x/d)) for d < x, gives #{p ≤ x:d∣p + h} ≤ 2x/(φ(d)log(x/d)) ≤ 4.1 x/(φ(d)logx) for d ≤ x ' and x large. Divide by π(x) − π(|h|)∼x/logx.
Theorem 11.3
(Limit law). [Proved] Let h ≠ 0 be a fixed integer. As x → ∞, the random variable 𝔖0(p + h), with p uniform among the primes |h| < p ≤ x, converges in distribution to Yh.
Proof. 
Fix y ≥ 5 and put S 0 ( y ) ( n ) = ∏ l ∣ n ,   2 < l ≤ y a l and Y h ( y ) = ∏ 2 < l ≤ y ,   l ∤ h a l B l .
Step 1 (bounded range). For p > |h| no prime 𝓁∣h divides p + h. The indicators (1𝓁∣p+h)2<𝓁≤y, 𝓁∤h are determined by p modulo m y = ∏ 2 < l ≤ y l , and 𝓁∣p + h is one of the 𝓁 − 1 unit classes modulo 𝓁. By the prime number theorem in arithmetic progressions the primes are asymptotically equidistributed among the φ(my) unit classes modulo my, so by the Chinese remainder theorem the vector of indicators converges in distribution to independent Bernoulli variables with parameters 1/(𝓁 − 1). Hence S 0 ( y ) ( p + h ) ⇒ Y h ( y ) .
Step 2 (tail). Let D y ( n ) = log S 0 ( n ) − log S 0 ( y ) ( n ) = ∑ l ∣ n ,   l > y log a l ≤ ∑ l ∣ n ,   l > y 2 / l by Lemma 2.3. For n = p + h ≤ x' there is at most one prime divisor l > x ' , contributing at most 2 / x ' . For y < l ≤ x ' , Lemma 11.2 gives ℙx(𝓁∣p + h) ≤ 5/(𝓁 − 1). Hence, for x ≥ x0,
E x D y ≤ 2 x ' + ∑ y < l ≤ x ' 2 l ⋅ 5 l − 1 ≤ o ( 1 ) + 10 ∑ n > y 1 n − 1 − 1 n ≤ 10 y − 1 + o ( 1 )
as x → ∞ (the finitely many p ≤ |h| are excluded from the average). By Markov’s inequality, limsupxℙx(Dy > ε) ≤ 10/(ε(y − 1)) → 0 as y → ∞.
Step 3.  Y h ( y ) ↑ Y h almost surely as y → ∞, hence in distribution. The approximation theorem for weak convergence [23] applied to log S 0 ( y ) ( p + h ) , log𝔖0(p + h) and log Y h ( y ) , followed by the continuous map exp, gives the theorem.
Lemma 11.4
(Uniform integrability).[Proved] Let h ≠ 0 be an integer and λ > 0. Then sup x ≥ x 0 1 π ( x ) ∑ | h | < p ≤ x exp λ ∑ l ∣ p + h ,   l > 2 1 / l < ∞ . Consequently, for every m > 0, sup x ≥ x 0 E x S 0 ( p + h ) m < ∞ .
Proof. 
Choose y ≥ max(2λ,5), to be fixed below, and put x' = x + |h|, n = p + h. Split the primes 𝓁∣n into 𝓁 ≤ y, y < l ≤ x ' and l > x ' . The first range contributes a factor at most K y = exp ( λ ∑ l ≤ y 1 / l ) and the last at most e λ / x ' ≤ 2 . For the middle range write T ( n ) = ∑ y < l ≤ x ' ,   l ∣ n 1 / l . Then e λT ( n ) = ∏ ( 1 + ( e λ / l − 1 ) ) = ∑ d ∣ n g ( d ) with g ( d ) = ∏ l ∣ d ( e λ / l − 1 ) ≤ ( 2 λ ) ω ( d ) / d , the sum running over squarefree d with all prime factors in ( y , x ' ] ; we used et − 1 ≤ 2t for 0 ≤ t ≤ 1 2 and λ / l ≤ 1 2 . Terms with d > x ' contribute at most τ(n)(2λ)ω(n)x' −1/2≪x' −1/2+ε. For 1 < d ≤ x ' , Lemma 11.2 gives ℙx(d∣p + h) ≤ 5/φ(d) for large x (and 0 if gcd(d,h) > 1). Therefore
E x e λT ≤ 1 + 5 ∑ d > 1 g ( d ) φ ( d ) + o ( 1 ) ≤ 1 + 5 ∏ l > y 1 + 2 λ l ( l − 1 ) − 1 + o ( 1 ) ≤ 3
for y = y(λ) large and x large. The last statement follows from S 0 ( n ) m ≤ exp ( 3 m ∑ l ∣ n 1 / l ) (Lemma 2.3).
Theorem 11.5
(Convergence of all moments).[Proved] For every integer h ≠ 0 and every m > 0, lim x → ∞ 1 π ( x ) ∑ | h | < p ≤ x S 0 ( p + h ) m = A m ( h ) = ∏ l > 2 ,   l ∤ h 1 + a l m − 1 l − 1 .
Proof. 
By Theorem 11.3, S 0 ( p + h ) m ⇒ Y h m . By Lemma 11.4 with m replaced by m + 1 the family {𝔖0(p + h)m} is uniformly integrable, so the expectations converge [23] to E Y h m = M h ( m ) ; the product formula is Proposition 11.1(ii).
Proposition 11.6
(Certified enclosures of Am(h)). [Comp. Verified, double precision over the 664,578 odd primes ≤Q = 107] Let Q ≥ 2m + 3 and Am(h;Q) be the product truncated to 𝓁 ≤ Q. Then Am(h;Q) ≤ Am(h) ≤ Am(h;Q)exp(2m/(Q − 1)). For Q = 107 the enclosures are in Table 12.
Proof. 
Every factor is at least 1, which gives the lower bound. For 𝓁 > Q, a l m − 1 ≤ e m / ( l − 2 ) − 1 ≤ 2 m / ( l − 2 ) because m / ( l − 2 ) ≤ 1 2 ; hence log 1 + a l m − 1 l − 1 ≤ 2 m ( l − 2 ) ( l − 1 ) and ∑ n > Q 2 m ( n − 2 ) ( n − 1 ) = 2 m Q − 1 . The tabulated values are the truncated products and their inflation by this factor.
Proposition 11.7
(Dependence on the shift and amplification).[Proved] (i) If h,h'are nonzero integers with the same set of odd prime divisors, then Yh and Y h ' have the same law, and A m ( h ) = A m ( 1 ) ∏ l ∣ h ,   l > 2 1 + a l m − 1 l − 1 − 1 ; in particular A 1 ( 3 ) = A 1 ( 1 ) / 3 2 . If every odd prime divisor of h2also divides h1, there is a coupling with Y h 1 ≤ Y h 2 almost surely, so Am(h1) ≤ Am(h2) for all m; in particular the maximal bias is attained exactly for the shifts without odd prime divisors, e.g. h = ±1. (ii) Let U = ∏ l > 2 a l C l with independent ℙ(C𝓁 = 1) = 1/𝓁 (the model for 𝔖0(n) over all even n). Then 𝔼U = 1/C2 and 𝔼Um < Am(1) for every m > 0. (iii) Var(Yh) = A2(h) − A1(h)2 > 0.
Proof. 
(i) The first part is immediate from the product formula; for m = 1, 𝓁 = 3: 1 + a 3 − 1 2 = 1 + 1 2 = 3 2 . For the monotonicity, couple both products through the same family (B𝓁): Y h 1 omits every factor omitted by Y h 2 , and possibly more, and every factor is at least one. (ii) E U = ∏ l > 2 1 + a l − 1 l = ∏ ( l − 1 ) 2 l ( l − 2 ) = 1 / C 2 , and termwise 1 + a l m − 1 l < 1 + a l m − 1 l − 1 . (iii) Choose an odd prime r∤h and write Y h = a r B r Z with Z = ∏ l > 2 ,   l ∤ hr a l B l independent of Br; conditionally on Z, Yh takes the two distinct values Z and arZ with positive probability, so Yh is not almost surely constant.
Theorem 11.8
(Moment generating function and tails).[Proved] There is an absolute constant C0such that:
  • for every integer h ≠ 0 and real s ≥ 3, logMh(s) ≤ sloglogs + C0s; in particular E Y h s < ∞ for every real s;
  • with c 0 = e − C 0 − 1 , ℙ(Yh > y) ≤ exp(−exp(c0y)) for all y with exp(c0y) ≥ 3;
  • for h = 1 and y ≥ 1, ℙ(Y1 > y) ≥ exp(−2exp(ey)); hence c 0 y ≤ loglog 1 P ( Y 1 > y ) ≤ e y + 1 for large y;
  • for every h ≠ 0, the law of Yh has unbounded support.
Proof. 
(1) For real s > 0, Y h s = ∏ a l s B l is a product of independent nonnegative factors, so by monotone convergence E Y h s equals the product in [1,∞]; every factor is ≥1, whence Mh(s) ≤ M1(s). For 3 ≤ 𝓁 ≤ s + 2, a l s ≤ e s / ( l − 2 ) and log(1 + et) ≤ t + log2 give a contribution ≤ s l − 2 + log 2 ; summing over these 𝓁 and using Mertens’ theorem, this is ≤sloglogs + C1s. For 𝓁 > s + 2, t = s/(𝓁 − 2) < 1 and a l s − 1 ≤ 2 t , so the contribution of these primes is at most 2 s ∑ n > s + 2 1 ( n − 2 ) ( n − 1 ) ≤ 2 . This proves (1) with an absolute C0.
(2) By Markov’s inequality, ℙ(Yh > y) ≤ Mh(s)e−slogy ≤ exp(s(loglogs + C0 − logy)). Choose s = exp(c0y), so that loglogs = logy − C0 − 1; the exponent is −s.
(3) If B𝓁 = 1 for all 3 ≤ 𝓁 ≤ r then, since log a l ≥ 1 l − 1 > 1 l and by Mertens’ theorem, log Y 1 > ∑ 3 ≤ l ≤ r 1 l ≥ loglog r − 1 . Taking r=⌈exp(ey)⌉ this exceeds logy. The probability of this event is ∏ 3 ≤ l ≤ r 1 l − 1 ≥ ∏ l ≤ r 1 l = e − θ ( r ) ≥ e − 1.01624   r by Rosser–Schoenfeld [11], which is ≥exp(−2exp(ey)) for y ≥ 1. The two-sided statement follows from (2) and (3).
(4) For distinct odd primes r1<…<rk not dividing h, the event B r 1 = … = B r k = 1 has probability ∏ j 1 r j − 1 > 0 , and on this event Y h ≥ ∏ j a r j . Since ∑ l ∤ h log a l ≥ ∑ l ∤ h 1 l − 1 = ∞ , these finite products tend to infinity, so every level is exceeded with positive probability.
Theorem 11.9
(Continuity).[Proved] Let 𝒬(Z;λ) = suptℙ(t ≤ Z ≤ t + λ). There is an absolute constant 𝒜 such that for every integer h ≠ 0 and 0 < λ < 1 2 , Q ( log Y h ; λ ) ≤ A ∑ l > 2 ,   l ∤ h ,   log a l > λ 1 l − 1 − 1 / 2 ≪ h ( loglog ( 1 / λ ) ) − 1 / 2 . In particular logYh, and hence Yh, has no atoms.
Proof. 
By independence, 𝒬(S + T;λ) ≤ 𝒬(S;λ) for a partial sum S and an independent remainder T. Apply the Kolmogorov–Rogozin inequality [24], Q ( ∑ X i ; λ ) ≤ A λ ∑ λ i 2 ( 1 − Q ( X i ; λ i ) ) − 1 / 2 for 0 < λi ≤ λ, with λi = λ, to the variables X𝓁 = B𝓁loga𝓁, 𝓁∤h. For λ < loga𝓁 the variable X𝓁 takes two values with probabilities 1 − 1 l − 1 and 1 l − 1 , so 1 − Q ( X l ; λ ) = 1 l − 1 (recall 𝓁 ≥ 3). Every prime 𝓁 < 1/λ satisfies loga𝓁 > 1/𝓁 > λ, and ∑ l < 1 / λ 1 l − 1 ≥ loglog ( 1 / λ ) − c h by Mertens’ theorem.
Remark 11.10.
[Honest Caveat] Since log Y h = ∑ B l log a l is an almost surely convergent series of independent discrete random variables, the Jessen–Wintner purity theorem [25] shows that its law is of pure type: purely discrete, purely singular continuous, or purely absolutely continuous. Theorem 11.9 excludes the first case. Which of the other two occurs is Open Question 12.11.
Corollary 11.11
(Law of the main term along p + h). [Proved] Let q = 2k, a odd, h an odd integer, and N = p + h. Then Ma,q(N)/(2C2N/φ(q)) = 𝔖0(N), so as p → ∞ this ratio converges in distribution to Yh, its moments converge to Am(h), and for every y the limiting probability that the ratio exceeds y equals ℙ(Yh > y) ≤ exp(−exp(c0y)) (the law of Yh has no atoms, so every y is a continuity point).
Proof. 
The identity is (2); the rest is Theorems 11.3, 11.5, 11.8 and 11.9.
Proposition 11.12
(Comparison with the primes up to 107). [Comp. Verified, all primes p with max(|h|,2) < p ≤ 107, 𝔖0(p + h) from a multiplicative sieve] The empirical moments of 𝔖0(p + h) for m = 1,2,3,4 are 1.742811,3.460872,7.629995,18.178527 at h = 1 (664,578 primes) and 1.161863,1.384401,1.695818,2.139393 at h = 3 (664,577 primes), to be compared with Table 12.
Theorem 11.13
(Law of the restricted Goldbach function along shifted primes).[Proved] Let q = 2k with k ≥ 1, a odd and h an odd integer. For a prime p > max(|h|,2) put Z a , q , h ( p ) : = φ ( q )   R a , q ( p + h ) 2 C 2   ( p + h ) . As p runs over the primes ≤x, Za,q,h(p) converges in distribution to Yh, and for every m > 0 its m-th moment converges to Am(h).
Proof. 
Write Z = Za,q,h(p) and N = p + h, so that φ(q)Ma,q(N)/(2C2N) = 𝔖0(N) by (2).
Convergence in distribution. Fix ε > 0. Apply Corollary 6.7 with A = 1 and A' = 2: all but O(X(logX)−2) = o(π(X)) primes p ≤ X satisfy | Z − S 0 ( N ) | ≤ φ ( q ) 2 C 2 ( log N ) − 1 , and the right side is <ε once p is large. Hence ℙX(|Z − 𝔖0(p + h)| ≥ ε) → 0 for every ε > 0, and by Theorem 11.3 and the standard Slutsky-type theorem [23], Z ⇒ Yh.
Moments. Since 0 ≤ Ra,q(N) ≤ R(N) ≤ (logN)2#{p' ≤ N:N − p' prime}, the upper-bound sieve (see [26]) gives R ( N ) ≪ N ∏ p ' ∣ N ( 1 + 1 / p ' ) uniformly for even N. Hence Z ≤ C q exp ( ∑ l ∣ N ,   l > 2 1 / l ) with Cq depending only on q. By Lemma 11.4 with λ = m + 1, supx𝔼xZm+1 < ∞, so {Zm} is uniformly integrable and E x Z m → E Y h m = A m ( h ) by weak convergence [23].
Corollary 11.14
(Mean number of restricted representations of p + h). [Proved] For q = 2k, a odd and h odd, lim x → ∞ 1 π ( x ) ∑ | h | < p ≤ x R a , q ( p + h ) 2 ( p + h ) / φ ( q ) = C 2 A 1 ( h ) , and C2A1(1) ∈ [1.15048,1.15049], which is strictly larger than 1 = C2𝔼U (Proposition 11.7(ii)). In words: relative to a generic even integer of the same size, p + 1 has on average about 1.1505 times as many restricted representations.
Proof. 
Theorem 11.13 with m = 1 gives that Za,q,h has mean tending to A1(h); multiply by C2. The numerical range follows from Propositions 2.2 and 11.6: the product of the lower endpoints is 1.1504807… and the product of the upper endpoints is 1.1504810….
Proposition 11.15
(The restricted function along p + h, q = 8). [Comp. Verified, R1,8(N) by double-precision FFT convolution for all even N ≤ 3 × 106; primes p with 105 ≤ p and p + h ≤ 3 × 106] Put Z = φ(8)R1,8(p + h)/(2C2(p + h)) with C2 = 0.6601618158. For h = 1 (207,224 primes) the first three empirical moments of Z are 1.7290,3.4122,7.4824, against Am(1) = 1.7427,3.4607,7.6303. For h = 3 (207,223 primes) they are 1.1563,1.3713,1.6723, against Am(3) = 1.1618,1.3843,1.6956. No prime in this range has R1,8(p + h) = 0.
Remark 11.16.
[Honest Caveat] The preceding proposition is a finite-range measurement. The empirical moments lie below Am(h) by 0.5% to 2%, which is the size of the lower-order deficit of Ra,q(N) against Ma,q(N) at N ≤ 3 × 106 (compare Table 8); the proof of Theorem 5.1 is asymptotic with an ineffective implied constant, and the proposition proves nothing about the rate of convergence or about the limit.

11.2. The Joint Law at the Shifts +1 and −1

The local events 𝓁∣p + 1 and 𝓁∣p − 1 are mutually exclusive for every odd prime 𝓁, so the amplitudes 𝔖0(p + 1) and 𝔖0(p − 1) are not asymptotically independent. Both shifts are admissible in Section 11 (𝓁∤±1 for every odd 𝓁), and each coordinate has the law Y1 by Theorem 11.3. [Comparison with the preceding version] Version 12 of [7] treated the law of the amplitude at a single shift and listed the joint law for several shifts as open (Open Question 12.12 there); the pair of shifts +1 and −1 is new in the present version.
Definition 11.17
(Pair model).For each odd prime 𝓁 let ( B l , B l ' ) take the values (1,0) and (0,1) with probability 1/(𝓁 − 1) each and the value (0,0) with probability (𝓁 − 3)/(𝓁 − 1), independently over 𝓁; the value (1,1) has probability 0. Put
Y + : = ∏ l > 2 a l B l ,     Y − : = ∏ l > 2 a l B l ' .
Each of B𝓁 and B l ' is Bernoulli with parameter 1/(𝓁 − 1), so Y+ and Y− each have the law of Y1. They are not independent: for every odd 𝓁 the events {B𝓁 = 1} and { B l ' = 1 } are disjoint (for 𝓁 = 3 they are complementary).
Lemma 11.18
(Joint local law).[Proved] Let 𝓁1,…,𝓁r be distinct odd primes. As p ranges over the primes, the vector ( 1 l j ∣ p + 1 , 1 l j ∣ p − 1 ) j ≤ r converges in distribution to ( B l j , B l j ' ) j ≤ r of Definition 11.17.
Proof. 
Put L = 𝓁1 … 𝓁r. For an odd prime 𝓁 the classes p≡−1 and p≡1 (𝓁) are two distinct reduced classes, and the remaining 𝓁 − 3 reduced classes satisfy neither 𝓁∣p + 1 nor 𝓁∣p − 1. Any prescribed combination of the 2r conditions determines, by the Chinese remainder theorem, a union of reduced classes modulo L whose number is ∏ j c j with cj ∈ {1,𝓁j − 3} (and 0 for the impossible combination (1,1)). The prime number theorem in arithmetic progressions assigns the density 1/φ(L) to each reduced class, so the limiting probability is ∏ j c j / ( l j − 1 ) , the product of the local probabilities of Definition 11.17. The finitely many primes p∣L do not affect the limit.
Theorem 11.19 (Joint limit law for the shifts ±1). [Proved] As p ranges over the primes, ( S 0 ( p + 1 ) , S 0 ( p − 1 ) ) → d ( Y + , Y − ) . Moreover, for all integers m,m' ≥ 0 with m + m' ≥ 1, lim x → ∞ 1 π ( x ) ∑ p ≤ x S 0 ( p + 1 ) m S 0 ( p − 1 ) m ' = E ( Y + ) m ( Y − ) m ' = ∏ l > 2 1 + a l m − 1 l − 1 + a l m ' − 1 l − 1 .
Proof. 
Weak convergence. For y ≥ 5 put S 0 ( y ) ( n ) = ∏ 3 ≤ l ≤ y ,   l ∣ n a l , and let Y ± , ( y ) = ∏ 3 ≤ l ≤ y a l B l , respectively a l B l ' . For fixed y, Lemma 11.18 and the continuous mapping theorem give ( S 0 ( y ) ( p + 1 ) , S 0 ( y ) ( p − 1 ) ) ⇒ ( Y + , ( y ) , Y − , ( y ) ) . For the discarded part let σ ∈ {1,−1}, x ≥ x0 and n = p + σ ≤ x' = x + 1. As in Step 2 of the proof of Theorem 11.3, 0 ≤ log S 0 ( n ) − log S 0 ( y ) ( n ) = D y ( n ) with 𝔼xDy(p + σ) ≤ 10/(y − 1) + o(1), by Lemma 11.2 applied with h = σ. Markov’s inequality and a union bound over the two coordinates give, for every η > 0,
limsup x → ∞ P x max σ = ± 1 D y ( p + σ ) > η ≤ 20 η ( y − 1 ) → 0   ( y → ∞ ) .
On the model side, E ∑ l B l log a l = ∑ l log a l l − 1 < ∞ and likewise for B l ' , so (logY+,(y),logY−,(y)) → (logY+,logY−) almost surely as y → ∞. The approximation theorem for convergence in distribution [23], applied in ℝ2, gives ( log S 0 ( p + 1 ) , log S 0 ( p − 1 ) ) → d ( log Y + , log Y − ) , and the continuous map (s,t) ↦ (es,et) gives the first claim.
Moments. Let m,m' ≥ 0 with m + m' ≥ 1, and put s = m + m' + 1, X = 𝔖0(p + 1), Z = 𝔖0(p − 1). By Hölder’s inequality with the exponents (m + m')/m and (m + m')/m' (when m,m' ≥ 1; the one-variable cases are direct),
E x ( X m Z m ' ) s / ( m + m ' ) ≤ ( E x X s ) m / ( m + m ' ) ( E x Z s ) m ' / ( m + m ' ) ,
which is bounded uniformly in x by Lemma 11.4 with m = s for h = 1 and h = −1. As s/(m + m') > 1, the family X m Z m ' is uniformly integrable, so the weak convergence just proved yields convergence of the means [23] to E [ ( Y + ) m ( Y − ) m ' ] . By independence over 𝓁 and monotone convergence (all factors are ≥1), E [ ( Y + ) m ( Y − ) m ' ] = ∏ l > 2 E   a l m B l + m ' B l ' , and a l m B l + m ' B l ' equals a l m with probability 1/(𝓁 − 1), a l m ' with probability 1/(𝓁 − 1) and 1 otherwise, which is the stated local factor. The product converges because a l m − 1 = O m ( 1 / l ) and ∑ l 1 l ( l − 1 ) < ∞ .
Corollary 11.20
(Negative dependence of the two amplitudes).[Proved] Put u l = a l − 1 l − 1 = 1 ( l − 1 ) ( l − 2 ) . Then E [ Y + Y − ] = ∏ l > 2 ( 1 + 2 u l ) , E Y + = E Y − = A 1 ( 1 ) = ∏ l > 2 ( 1 + u l ) , and Cov ( Y + , Y − ) = ∏ l > 2 ( 1 + 2 u l ) − A 1 ( 1 ) 2 < 0 .
Consequently ρ∞:=Cov(Y+,Y−)/Var(Y1) ∈ [−1,0) is strictly negative. Moreover the Pearson correlation of 𝔖0(p + 1) and 𝔖0(p − 1) over the primes p ≤ x converges to ρ∞ as x → ∞.
Proof. 
The first two formulas are Theorem 11.19 with (m,m') = (1,1) and (1,0),(0,1). Since ( 1 + u l ) 2 = 1 + 2 u l + u l 2 > 1 + 2 u l
for every 𝓁, the product of the local inequalities (all factors positive, both products convergent) gives ∏ ( 1 + 2 u l ) < ∏ ( 1 + u l ) 2 = A 1 ( 1 ) 2
. The two variances equal Var(Y1) = A2(1) − A1(1)2 > 0 (Proposition 11.7(iii)), so ρ∞ ∈ [−1,0) by the Cauchy–Schwarz inequality. The sample correlation converges because the first moments of both amplitudes, their second moments and the mixed moment all converge by Theorem 11.19.
Proposition 11.21 (Certified value of ρ∞). [Comp. Verified] At Q = 107, evaluated in 40-digit decimal arithmetic over the 664,578 odd primes 𝓁 ≤ Q with the tail factors below, ∏ l > 2 ( 1 + 2 u l ) ∈ [ 2.6802939107 ,   2.6802944469 ] , Cov ( Y + , Y − ) ∈ [ − 0.35679913 ,   − 0.35679737 ] , ρ ∞ ∈ [ − 0.842215 ,   − 0.842204 ] .
Proof. 
The lower end of the product is its truncation at Q; the upper end is the truncation inflated by the tail factor exp(2/(Q − 1)), since ∑ l > Q log ( 1 + 2 u l ) ≤ 2 ∑ n > Q 1 ( n − 1 ) ( n − 2 ) = 2 Q − 1 . The covariance interval is [ Π lo − ( A 1 hi ) 2 , Π hi − ( A 1 lo ) 2 ] with the enclosures A1(1) ∈ [1.7427254015,1.7427257502] and A2(1) ∈ [3.46073716,3.46073855], which follow in the same way from Proposition 11.6; the variance lies in [0.4236441,0.4236468], and ρ∞ is bounded below by Covlo/Varlo and above by Covhi/Varhi, the covariance being negative. The rounding error of the 40-digit arithmetic is below 10−30, far smaller than the widths of the intervals.
Proposition 11.22
(Sample correlation of the pair). [Comp. Verified, exact factorisations of p ± 1 by a multiplicative sieve, primes 3 ≤ p ≤ pN] The Pearson correlations of 𝔖0(p + 1) and 𝔖0(p − 1) inTable 13lie in [−0.8455,−0.8430] at all six scales and differ from ρ∞ by at most 0.0033.

11.3. A Quaternary Analogue

For an odd prime 𝓁 and an integer n, let ν𝓁(n) be the number of (x1,…,x4) ∈ ((ℤ/𝓁)*)4 with x1 + x2 + x3 + x4≡n (𝓁).
Lemma 11.23
(Local density for four primes).[Proved] ν𝓁(n) = ((𝓁 − 1)4 + c𝓁(n))/𝓁. Consequently the ratio of the normalised local densities 𝓁 ν𝓁(n)/(𝓁 − 1)4 for 𝓁∣n and 𝓁∤n is a l ( 4 ) : = 1 + ( l − 1 ) − 3 1 − ( l − 1 ) − 4 = ( l − 1 ) ( l 2 − 3 l + 3 ) ( l − 2 ) ( l 2 − 2 l + 2 ) = 1 + 1 ( l − 2 ) ( l 2 − 2 l + 2 )
.
Proof. 
Orthogonality gives ν l ( n ) = 1 l ∑ t   mod   l e   − tn / l ∑ x ≠ 0 e   tx / l 4 = 1 l ( l − 1 ) 4 + ∑ t ≠ 0 e   − tn / l
, and ∑ t ≠ 0 e   − tn / l = c l ( n ) . The two normalised densities are 1 + (𝓁 − 1)−3 (if 𝓁∣n) and 1 − (𝓁 − 1)−4 (if 𝓁∤n). Using (𝓁 − 1)3 + 1 = 𝓁(𝓁2 − 3𝓁 + 3) and (𝓁 − 1)4 − 1 = 𝓁(𝓁 − 2)(𝓁2 − 2𝓁 + 2) the ratio simplifies as stated, and (𝓁 − 1)(𝓁2 − 3𝓁 + 3) − (𝓁 − 2)(𝓁2 − 2𝓁 + 2) = 1 gives the last form.
The variable local factor of the singular series of Section 10 is S 4 ∘ ( n ) = ∏ l ∣ n ,   l > 2 a l ( 4 ) . For h ≠ 0 let Z h : = ∏ l > 2 ,   l ∤ h ( a l ( 4 ) ) B l with the same Bernoulli variables as in (8), and
A m ( 4 ) ( h ) : = ∏ l > 2 l ∤ h 1 + ( a l ( 4 ) ) m − 1 l − 1 ,     A ∞ ( 4 ) ( h ) : = ∏ l > 2 l ∤ h a l ( 4 ) .
Proposition 11.24
(Quaternary analogue). [Proved] Let h ≠ 0 be a fixed integer.
  • A ∞ ( 4 ) ( h ) < ∞ , and as x → ∞, S 4 ∘ ( p + h )  (with p uniform among the primes |h| < p ≤ x) converges in distribution to Zh.
  • For every m > 0, 1 π ( x ) ∑ | h | < p ≤ x S 4 ∘ ( p + h ) m → A m ( 4 ) ( h ) = E Z h m
  • Z h ≤ A ∞ ( 4 ) ( h )  surely and ess   sup Z h = A ∞ ( 4 ) ( h ) ; in particular the law of Zh has bounded support, whereas the law of Yh has unbounded support (Theorem 11.8(4)).
  • 1 < A 1 ( 4 ) ( 1 ) < A 1 ( 1 ) .
Proof. 
Since a l ( 4 ) − 1 = 1 ( l − 2 ) ( l 2 − 2 l + 2 ) ≤ 1 ( l − 2 ) 3 , ∑ l log a l ( 4 ) < ∞ and A ∞ ( 4 ) ( h ) < ∞ .
(1) Steps 1 and 3 of the proof of Theorem 11.3 apply verbatim. In Step 2, for 𝓁 > y ≥ 5 one has log a l ( 4 ) ≤ a l ( 4 ) − 1 < 1 l − 2 ≤ 2 l because 𝓁2 − 2𝓁 + 2 > 1; hence the tail D y ( 4 ) ( n ) = ∑ l ∣ n ,   l > y log a l ( 4 ) satisfies D y ( 4 ) ( n ) ≤ ∑ l ∣ n ,   l > y 2 / l , which is the bound used for Dy, and the same estimate E x D y ( 4 ) ≤ 10 / ( y − 1 ) + o ( 1 ) follows.
(2) S 4 ∘ ( n ) ≤ A ∞ ( 4 ) ( 1 ) for every n, so the powers S 4 ∘ ( p + h ) m are bounded and the moments converge by weak convergence; the product formula follows by independence.
(3) Since B𝓁 ∈ {0,1} and a l ( 4 ) > 1 , Z h ≤ A ∞ ( 4 ) ( h ) . For the essential supremum, for the first k primes r1<…<rk not dividing h the event B r 1 = … = B r k = 1 has probability ∏ j 1 r j − 1 > 0 and on it Z h ≥ ∏ j a r j ( 4 ) → A ∞ ( 4 ) ( h ) .
(4) Both products have local factors exceeding 1, and a l ( 4 ) − 1 l − 1 < a l − 1 l − 1 for every odd 𝓁 because 𝓁2 − 2𝓁 + 2 > 1.
Proposition 11.25
(Numerical values).[Comp. Verified, partial products over all odd primes 𝓁 ≤ 107; tails below 10−12] A 1 ( 4 ) ( 1 ) = 1.106607210 and A ∞ ( 4 ) ( 1 ) = 1.23316805 , to be compared with A1(1) = 1.7427254; thus A 1 ( 4 ) ( 1 ) − 1 ≈ 0.1066 against A1(1) − 1≈0.7427.
Proof. 
The partial products are 1.1066072097619… and 1.2331680454971…. The tails are bounded by ∑ n > Q ( n − 2 ) − 4 < 10 − 21 for the first and ∑ n > Q ( n − 2 ) − 3 < 10 − 13 for the second, with Q = 107.
Corollary 11.26
(Law of the four-prime count along p + h). [Proved] Let h be an odd integer and N = p + h. As p runs over the primes, r4(p + h)/(2C4(p + h)3/6) converges in distribution to Zh, and for every m > 0 its m-th moment converges to A m ( 4 ) ( h ) .
Proof. 
For odd p > |h| the integer N = p + h is even. By Theorem 10.6 with A = 1 and (7), r 4 ( N ) / ( 2 C 4 N 3 / 6 ) = S 4 ∘ ( N ) + O ( 1 / log N ) with an absolute implied constant, uniformly in N. Proposition 11.24(1) and Slutsky’s theorem give the convergence in distribution. The ratio is bounded by A ∞ ( 4 ) ( 1 ) + O ( 1 / log N ) , so the moments converge by bounded convergence, with limit A m ( 4 ) ( h ) by Proposition 11.24(2).
Remark 11.27.
[Honest Caveat] In contrast with the binary problem (Theorem 11.13), the limit law of the four-prime count along p + h requires no exceptional set, because Theorem 10.6 holds for every even N. The local obstruction ofSection 3is diluted when more free summands are present: the local factor is 1 + O(𝓁−3) rather than 1 + O(𝓁−1), which is what makes the limit law bounded. The statements of this subsection concern the unrestricted four-prime sum; no restricted four-prime sum is treated.

12. Open Questions

Open Question 12.1 (Power saving for progressions modulo 2k). [Open] Give a self-contained proof of # E a , q ( X ) ≪ q X 1 − Δ q for q = 2k and some explicit Δq > 0, tailored to the one-restricted-prime sum and using the exact coefficients of Proposition 4.7 together with zero-density estimates, and determine the dependence of Δq on k. The case q = 1 is the theorem of Montgomery and Vaughan [5]; the difficulty is to adapt the zero-density input to the character sums arising from Lemma 4.3. A power saving would give, via Corollary 6.4, #{pn ≤ X:Ra,q(Nn) = 0}≪X1−Δ.
Open Question 12.2 (Effective constants). [Open] Make Theorem 5.1 effective: replace the use of the Siegel–Walfisz theorem in Lemma 4.5 and the choice of P by explicit estimates, and give an explicit X1(q,a,c) beyond which #ℰa,q(3X) < π(X;q,c). The same question for the ternary threshold n0(q) in Corollary 10.2 and for the threshold N0 in Corollary 10.8. This requires an effective substitute for Lemma 4.5 for all moduli r' ≤ (logX)A+11 of the form r1 ⋅ 2s with r1 odd squarefree.
Open Question 12.3 (From almost all to all). [Open] Determine whether ℰa,q is finite for q = 2k. Neither Corollary 5.2 nor Corollary 6.6 settles this: each bounds the count of exceptional N up to X and none rules out an infinite, arbitrarily sparse sequence of exceptions. By Proposition 5.5, a uniform pointwise lower bound Ra,q(N) > 0 for all large even N is at least as strong as the classical binary Goldbach problem for large N; the gap is exactly the gap between mean-square control (Theorem 5.1) and pointwise control of E(N). The corresponding question along shifted primes is whether Ra,q(p + h) > 0 for all large p.
Open Question 12.4 (Pointwise bound under a named hypothesis). [Open] Exhibit an explicit function η(N) → 0, derived from a stated classical hypothesis (GRH for L(s,χ) with χ modulo q, a density hypothesis, or a pair-correlation hypothesis in a stated strength), such that |Ra,q(N) − Ma,q(N)| ≤ η(N)N for all large even N, together with a complete derivation. For the unrestricted problem GRH is known to give only an exceptional set of size O(X1/2+ε), which is a statement about almost all N, not a pointwise bound.
Open Question 12.5 (General moduli: a mean-square theorem and a self-contained proof). [Open] Corollary 3.9 gives an L1 mean-value theorem for every fixed q by importing Theorem 3.8. (a) Prove the L2 analogue ∑ N ≤ X | R a , q ( N ) − M ~ a , q ( N ) | 2 ≪ A , q X 3 ( log X ) − A for q with an odd prime factor. (b) Compute the analogue of Proposition 4.7 for such q, so that the shift decomposition of Lemma 4.3 gives a self-contained proof, uniform in q ≤ (logX)C. Proposition 9.8 shows that the ratio R a , q / M ~ a , q is close to 1 on the tested range.
Open Question 12.6 (Density of the obstruction). [Open] For q = 3, a = 1, decide whether the natural density of {n:pn≡pn+1≡2 (3)} exists; conditionally on the Hardy–Littlewood prime tuples conjecture it is 1/4 [20]. Determine the density of {n:R1,3(Nn) = 0}, which by Theorem 7.3 is the set {n:Nn≡1 (3)} with the indices for which Nn − 3 is prime removed, and therefore coincides in density with {n:Nn≡1 (3)} once the primes among Nn − 3 have density zero along this set; this last point is not established.
Open Question 12.7 (Frequency of the obstruction for general d and q). [Open] Theorem 7.5 proves that Ra,q(pn + pn+d) = 0 infinitely often when q has an odd prime factor. Determine whether the set of such n has a natural density, and its value, for each fixed d and q.
Open Question 12.8 (Class-dependent second moment). [Open] For q = 2k, decide whether the ratio of ∑ N ≡ 2 a   ( q ) D a , q ( N ) 2 to ∑ N ≢ 2 a   ( q ) D a , q ( N ) 2 (suitably normalised by the number of terms) has a limit as X → ∞, and its value; Proposition 9.1 and the variance-ratio proposition of Section 9 give values between 1.94 and 2.44 at q = 8,16,32.
Open Question 12.9 (True order of the second moment). [Open] Determine the order of ∑ N ≤ X | R a , q ( N ) − M a , q ( N ) | 2 . Theorem 5.1 bounds it by X3(logX)−A for every A; the size-of-the-second-moment proposition of Section 9 shows a local growth exponent near 2.14 on [2 × 105,6 × 106]. By Proposition 9.6 the question for the restricted sums is tied to the same question for the unrestricted error D(N). An unconditional power saving in the mean square for q = 2k is not established here.
Open Question 12.10 (Sharp upper tail of Yh). [Open] Theorem 11.8 gives exp(c0y) ≤ −logℙ(Y1 > y) ≤ 2exp(ey) for large y. Determine the true exponent, i.e. the asymptotics of log(−logℙ(Yh > y))/y as y → ∞ (if the limit exists).
Open Question 12.11 (Type of the law of Yh and rate of convergence). [Open] By Theorem 11.9, Yh is continuous. Since logYh is a sum of independent variables (a random series of Jessen–Wintner type), its law is either absolutely continuous or purely singular continuous (Remark following Theorem 11.9); determine which. Determine also the rate of convergence in Theorem 11.3 in the Kolmogorov distance as a function of x, and an explicit unconditional error term rm,h(x) in π ( x ) − 1 ∑ p ≤ x S 0 ( p + h ) m = A m ( h ) + O m , h ( r m , h ( x ) ) ; the same for the joint moments of Theorem 11.19.
Open Question 12.12 (Joint distribution for several shifts). [Open] Theorem 11.19 gives the joint limit law for the pair of shifts ±1. Determine the joint limit distribution of 𝔖0(p + h1),…,𝔖0(p + hk) for distinct shifts h1,…,hk in general (in particular for k ≥ 3, and for pairs other than ±1): for an odd prime 𝓁 dividing none of the hi, the events 𝓁∣p + hi and 𝓁∣p + hj coincide when 𝓁∣hi − hj and are disjoint otherwise, each having probability 1/(𝓁 − 1), giving a random Euler product with multinomial rather than independent Bernoulli local factors; the expected limit is the product over 𝓁 of the corresponding local laws, with mixed moments and a uniform-integrability bound for mixed moments.
Open Question 12.13 (Edge of the support in the quaternary law). [Open] Since Z h ≤ A ∞ ( 4 ) ( h ) surely (Proposition 11.24), determine the asymptotic behaviour of P ( Z h > A ∞ ( 4 ) ( h ) − ε ) as ε ↓ 0, i.e. the local behaviour of the law of Zh at the edge of its support. It is governed by how many small primes 𝓁 must satisfy B𝓁 = 1 simultaneously, and requires a large-deviation analysis of ∑ l ≤ L ( 1 − B l ) log a l ( 4 ) .

13. A Computational Protocol

All computations use double-precision arithmetic and a sieve of Eratosthenes, except the certification of Proposition 11.21, which uses 40-digit decimal arithmetic; every script first reproduced π(106) = 78,498, π(2 × 106) = 148,933, π(107) = 664,579 and π(108) = 5,761,455 before being trusted.
Constants. C2(P), G(P), Am(h;Q) and C4 are computed as sums of logarithms over the odd primes up to 107 (or 2 × 107, respectively 3 × 106, where stated) and then exponentiated; the truncation error is bounded rigorously by Propositions 2.2, 11.6 and 10.7. The quaternary constants of Proposition 11.25 are computed in the same way. In Proposition 11.21 the products ∏ ( 1 + 2 u l ) and Am(1;Q) are accumulated over the 664,578 odd primes 𝓁 ≤ Q = 107 with the tail factors stated there.
Representation counts. Ra,q(N) for all even N ≤ 6 × 106 (and for N ≤ 2 × 106 in Proposition 9.8, N ≤ 3 × 106 in the proposition on q = 8 of Section 11) is obtained from one FFT convolution of the log-weighted prime indicator restricted to p1≡a (q) with the unrestricted one; every nonzero value is at least log2 ⋅ logpmin, where pmin is the least prime ≡a (q), so the zeros are unambiguous. For the zero sets (Propositions 6.9 and the counts for q = 3) the unweighted indicator convolution is used and a value below 1/2 is an exact zero. 𝔖0(N) is evaluated exactly by a multiplicative sieve, and C2 is taken as 0.6601618158…. In Section 9 the second-moment statistics use all even N in the stated range. For Table 11, r4(N) for all even N ≤ 2 × 105 is obtained from two successive FFT convolutions of the log-weighted indicator of all primes (including 2) with itself, and 𝔖4(N) from (7) by exact factorisation of N.
Exact coefficients and main terms. In the check of the factorisation the denominators rb,h are computed with exact rational arithmetic and the exponentials in double precision; in the check of the two closed forms the two expressions are evaluated independently, the second by an explicit product over all odd primes up to 2 × 106. The triples there are drawn with numpy.random.default_rng(20261019): first q uniform in {1,…,60} and a uniform in {1,…,q}, discarding the draw unless gcd(a,q) = 1, then N = 2m with m uniform in {1,…,106 − 1}, until 1500 triples are accepted.
Rays and gaps. Primes up to 108 come from a boolean sieve; transition matrices, joint frequencies, gap classes and the temporal-split predictor are computed from the array of consecutive primes. For the predictor, the context is the tuple of the last k rays and the prediction is the training-set mode.
Shifted primes. 𝔖0(p + h) was obtained for all primes max(|h|,2) < p ≤ 107 from a multiplicative sieve; since 𝓁∣h and 𝓁∣p + h force p = 𝓁 ≤ |h|, no correction for the primes dividing h is needed in this range. For Table 13, 𝔖0(n) is evaluated for all n ≤ p20000 + 3 by a multiplicative sieve and the correlations are Pearson correlations over the primes 3 ≤ p ≤ pN.

14. Conclusions

For the restricted Goldbach sum modulo a power of two, the additive-shift decomposition of Lemma 4.3 reduces every step of the classical circle-method argument to statements about the unrestricted exponential sum S, and the singular-series coefficients factor exactly (Proposition 4.7); this factorisation was also checked against its defining formula on 8280 cases. Combined with the Siegel–Walfisz theorem on the major arcs and Vaughan’s bound on the minor arcs, it gives an ineffective but log-power-saving mean-square theorem with exceptional set OA,q(X(logX)−A) for every fixed A > 0. An injective map into the even integers with at most linear growth transfers every bound on the exceptional set, which yields almost-all theorems along pn + pn+1, pn + pn+d and p + h uniformly in the ray of pn, with relative accuracy along p + h; they are informative only where the obvious representation by pn and pn+1 themselves is not available. The same machinery gives an asymptotic formula and positivity for the restricted ternary problem. For four primes it gives a pointwise asymptotic formula r4(N)∼𝔖4(N)N3/6 for every even N, with a singular series between 2C4≈1.8659 and 2.3010, while Helfgott’s theorem gives the representation p + 1 = 3 + q2 + q3 + q4 for every prime p > 7, and the anchor 3 serves every such prime and no odd anchor serves more.
For a modulus with an odd prime factor the same sequence exposes the local obstruction concretely: the condition Nn≡a (𝓁) is a condition on the pair of rays of two consecutive primes, it holds infinitely often by Shiu’s theorem, it recurs along pn + pn+d for every d ≥ 1 (Theorem 7.5), and for q = 3 it accounts exactly for every zero of R1,3(Nn) (Theorem 7.3). The correct main term for an arbitrary modulus is given by Definition 3.5, whose two closed forms coincide; an imported lemma of Tolev gives an almost-all statement with this main term on the admissible integers (Corollary 3.9), and the sum is within a few percent of it on every tested range. The frequency of the obstructed set is governed by the bias between consecutive primes discovered by Lemke Oliver and Soundararajan, which the tables above reproduce qualitatively, at a smaller scale than that of [20]. The symmetry p1 ↔ p2 doubles the relative variance of Ra,q(N) on the class N≡2a (q), and the rays of the past predict the next ray out of sample with accuracy about 0.31 to 0.32 but carry essentially no information on the size of the gap.
The odd part 𝔖0 of the singular series, evaluated along shifted primes, obeys an exact probabilistic law: S 0 ( p + h ) → d Y h for every fixed h ≠ 0 (Theorem 11.3), with every moment given by an explicit Euler product (Theorem 11.5), an entire moment generating function (Proposition 11.1), a non-atomic law of unbounded support (Theorems 11.9 and 11.8), and a doubly exponential upper tail (Theorem 11.8), strictly amplified relative to generic integers (Proposition 11.7). At the pair of shifts ±1 the joint law is a pair of random Euler products whose local factors are coupled by the exclusion of the events 𝓁∣p + 1 and 𝓁∣p − 1 (Theorem 11.19); the two amplitudes are strictly negatively dependent, with limit correlation in [−0.842215,−0.842204] (Corollary 11.20 and Proposition 11.21), and the sample correlation over the primes up to 224,737 stays within 0.0033 of it. Combined with the almost-all theorem along p + h, the normalised restricted Goldbach function itself has the same limit law as 𝔖0(p + h), with all moments (Theorem 11.13), so that p + 1 carries on average C2A1(1)≈1.1505 times the number of restricted representations of a generic even integer (Corollary 11.14). For the sum of four primes the analogous amplitude has an almost surely bounded limit law and a much weaker bias (Proposition 11.24), and, since the four-prime asymptotic holds for every even integer, this law is that of the four-prime count itself along p + h (Corollary 11.26). Unconditionally proved are exactly the statements labelled [Proved] (in Section 3, Section 4, Section 5, Section 6 and Section 7, apart from Theorem 3.8, which is labelled [Imported], and Corollary 3.9, which is labelled [Cond. Proved (Theorem 3.8)] because it holds only given that lemma; Propositions 8.1, 8.4, 9.1 and 9.6; and Section 10 and Section 11); the statements labelled [Comp. Verified] are finite computations; and the questions of Section 12 are open. Passing from almost all to all even integers is equivalent, for the restricted sum, to a statement at least as strong as the binary Goldbach conjecture for large N (Proposition 5.5), and has not been attempted.

References

  1. Hardy, G. H.; Littlewood, J. E. Some problems of ‘Partitio numerorum’; III: On the expression of a number as a sum of primes. Acta Math. 1923, vol. 44, 1–70. [Google Scholar] [CrossRef]
  2. van der Corput, J. G. Sur l’hypothèse de Goldbach pour presque tous les nombres pairs. Acta Arith. 1936, vol. 2(no. 2), 266–290. [Google Scholar] [CrossRef]
  3. Chudakov, N. G. Sur le problème de Goldbach. C. R. (Dokl.) Acad. Sci. URSS 1937, vol. 17, 335–338. [Google Scholar]
  4. Estermann, T. On Goldbach’s problem: proof that almost all even positive integers are sums of two primes. Proc. Lond. Math. Soc. (2) 1938, vol. 44(no. 1), 307–314. [Google Scholar] [CrossRef]
  5. Montgomery, H. L.; Vaughan, R. C. The exceptional set in Goldbach’s problem. Acta Arith. 1975, vol. 27, 353–370. [Google Scholar] [CrossRef]
  6. Pintz, J. A new explicit formula in the additive theory of primes with applications II. The exceptional set in Goldbach’s problem. arXiv 2018, arXiv:1804.09084. [Google Scholar]
  7. Anderson, F. Goldbach Sums in Progressions Modulo 2k: Almost-All Theorems and Shifted Primes. Prepr. 2026 (not peer-reviewed) 2026, version 12. [Google Scholar] [CrossRef]
  8. Anderson, F. Restricted Goldbach sums and the law of shifted primes. Preprints.org 2026, version 8. [Google Scholar] [CrossRef]
  9. Anderson, F. Structure of primes, shifted primes and Goldbach: the almost-all theorem for restricted sums modulo a power of two. Preprints.org 2026, version 10. [Google Scholar] [CrossRef]
  10. Anderson, F. Rays and gaps of Goldbach representations. Preprints.org 2026, version 2. [Google Scholar] [CrossRef]
  11. Rosser, J. B.; Schoenfeld, L. Approximate formulas for some functions of prime numbers. Ill. J. Math. 1962, vol. 6, 64–94. [Google Scholar] [CrossRef]
  12. Tolev, D. I. The binary Goldbach problem with arithmetic weights attached to one of the variables. Acta Arith. 2010, vol. 142(no. 2), 169–178. [Google Scholar] [CrossRef]
  13. Mikawa, H. On prime twins in arithmetic progressions. Tsukuba J. Math. 1992, vol. 16(no. 2), 377–387. [Google Scholar] [CrossRef]
  14. Laporta, M. A short intervals result for 2n-twin primes in arithmetic progressions. Tsukuba J. Math. 1999, vol. 23(no. 2), 201–214. [Google Scholar] [CrossRef]
  15. Davenport, H. Multiplicative Number Theory, 3rd ed.; Graduate Texts in Mathematics 74; Montgomery, H. L., Ed.; Springer-Verlag: New York, 2000. [Google Scholar]
  16. R. C. Vaughan, The Hardy–Littlewood Method. In Cambridge Tracts in Mathematics 125, 2nd ed.; Cambridge University Press: Cambridge, 1997.
  17. Vaughan, R. C. Sommes trigonométriques sur les nombres premiers. C. R. Acad. Sci. Paris Sér. A–B 1977, vol. 285, A981–A983. [Google Scholar]
  18. Heath-Brown, D. R.; Silverman, J. H. (Eds.) G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 6th ed.; Oxford University Press: Oxford, 2008. [Google Scholar]
  19. Shiu, D. K. L. Strings of congruent primes. J. Lond. Math. Soc. (2) 2000, vol. 61(no. 2), 359–373. [Google Scholar] [CrossRef]
  20. Lemke Oliver, R. J.; Soundararajan, K. Unexpected biases in the distribution of consecutive primes. Proc. Natl. Acad. Sci. USA 2016, vol. 113(no. 31), E4446–E4454. [Google Scholar]
  21. Helfgott, H. A. The ternary Goldbach conjecture is true. arXiv 2013, arXiv:1312.7748. [Google Scholar]
  22. Montgomery, H. L.; Vaughan, R. C. The large sieve. Mathematika 1973, vol. 20(no. 2), 119–134. [Google Scholar] [CrossRef]
  23. Billingsley, P. Convergence of Probability Measures, 2nd ed.; John Wiley & Sons: New York, 1999. [Google Scholar]
  24. Petrov, V. V. Limit Theorems of Probability Theory: Sequences of Independent Random Variables; Oxford Studies in Probability 4: Oxford; Clarendon Press, 1995. [Google Scholar]
  25. Jessen, B.; Wintner, A. Distribution functions and the Riemann zeta function. Trans. Amer. Math. Soc. 1935, vol. 38(no. 1), 48–88. [Google Scholar] [CrossRef]
  26. Halberstam, H.; Richert, H.-E. Sieve Methods; London Mathematical Society Monographs 4; Academic Press: London, 1974. [Google Scholar]
Table 1. Primes p with R1,8(p + h) = 0, 11 ≤ p ≤ 6 × 106 − 20. Each row gives a shift h: the number of exceptional primes p and the largest exceptional p+h found.
Table 1. Primes p with R1,8(p + h) = 0, 11 ≤ p ≤ 6 × 106 − 20. Each row gives a shift h: the number of exceptional primes p and the largest exceptional p+h found.
h exceptions largest exceptional p + h
−3 12 458
−1 6 66
1 12 458
3 10 362
5 4 66
7 9 218
9 13 458
Table 2. Smallest pairs pn < pn+d with pn≡pn+d≡c (mod qr), r∣N − 𝓁, N≡a (𝓁) and Ra,q(pn + pn+d) = 0 (search range p < 107), with r the least odd prime not dividing q and 𝓁 the least odd prime dividing q. Each row lists, for a modulus q, residue a and shift d, the smallest prime pair meeting the conditions (columns q, a, d, l, r, c, p_n, p_n+d, N); numerical examples for Theorem 7.5.
Table 2. Smallest pairs pn < pn+d with pn≡pn+d≡c (mod qr), r∣N − 𝓁, N≡a (𝓁) and Ra,q(pn + pn+d) = 0 (search range p < 107), with r the least odd prime not dividing q and 𝓁 the least odd prime dividing q. Each row lists, for a modulus q, residue a and shift d, the smallest prime pair meeting the conditions (columns q, a, d, l, r, c, p_n, p_n+d, N); numerical examples for Theorem 7.5.
q a d 𝓵 r c pn pn+d N
3 1 1 3 5 14 18869 18899 37768
3 1 2 3 5 14 2969 2999 5968
5 1 1 5 3 13 7963 7993 15956
9 2 1 3 5 19 1294849 1294939 2589788
10 3 1 5 3 19 5749 5779 11528
12 5 1 3 5 19 110359 110419 220778
Table 3. Ray counts modulo 10. Number of primes up to X lying in each residue class (ray) 1, 3, 7, 9 modulo 10, for X = 10^3 to 10^8; the four counts are nearly equal.
Table 3. Ray counts modulo 10. Number of primes up to X lying in each residue class (ray) 1, 3, 7, 9 modulo 10, for X = 10^3 to 10^8; the four counts are nearly equal.
X π(X) ray 1 ray 3 ray 7 ray 9
103 168 40 42 46 38
104 1,229 306 310 308 303
105 9,592 2,387 2,402 2,411 2,390
106 78,498 19,617 19,665 19,621 19,593
107 664,579 166,104 166,230 166,211 166,032
108 5,761,455 1,440,298 1,440,474 1,440,495 1,440,186
Table 4. ℙ(ρn+1 = b∣ρn = a) in percent, pairs below 108. Transition matrix between consecutive primes: the entry in row a, column b is the percentage of primes in ray a whose next prime lies in ray b; the diagonal is depleted.
Table 4. ℙ(ρn+1 = b∣ρn = a) in percent, pairs below 108. Transition matrix between consecutive primes: the entry in row a, column b is the percentage of primes in ray a whose next prime lies in ray b; the diagonal is depleted.
a∖b 1 3 7 9
1 17.70 30.39 31.03 20.87
3 23.64 16.67 28.69 31.01
7 25.58 27.32 16.68 30.42
9 33.08 25.62 23.62 17.68
Table 5. Gaps by size: share of all gaps and proportion keeping the ray (percent). For each range of the gap g_n between consecutive primes: the share of all gaps in that range and the percentage of them for which the next prime stays in the same ray.
Table 5. Gaps by size: share of all gaps and proportion keeping the ray (percent). For each range of the gap g_n between consecutive primes: the share of all gaps in that range and the percentage of them for which the next prime stays in the same ray.
gap gn share of all gaps keeping the ray
2–8 34.43 0.00
10–18 32.32 23.09
20–38 24.54 30.12
40–58 6.50 23.58
60–98 2.10 36.28
≥100 0.12 28.29
Table 6. Joint frequency of (pn mod 3,pn+1 mod 3) in percent. Observed percentage of each pair of residues modulo 3 of consecutive primes, at three scales N.
Table 6. Joint frequency of (pn mod 3,pn+1 mod 3) in percent. Observed percentage of each pair of residues modulo 3 of consecutive primes, at three scales N.
N pairs (1,1) (1,2) = (2,1) (2,2)
3 × 106 216,813 21.21 28.76 21.27
107 664,576 21.50 28.48 21.53
108 5,761,452 21.94 28.06 21.95
Table 7. Second moment of the error, q = 8, a = 1. Second moment of the error R − M, normalised by X^3 and by X^3/log X, for several values of X.
Table 7. Second moment of the error, q = 8, a = 1. Second moment of the error R − M, normalised by X^3 and by X^3/log X, for several values of X.
X ∑ N ≤ X ( R − M ) 2 / X 3 ∑ N ≤ X ( R − M ) 2 / ( X 3 / log X )
2 × 105 3.84 × 10−5 4.68 × 10−4
5 × 105 1.83 × 10−5 2.41 × 10−4
106 1.00 × 10−5 1.39 × 10−4
2 × 106 5.65 × 10−6 8.20 × 10−5
3 × 106 4.00 × 10−6 5.97 × 10−5
4.5 × 106 2.67 × 10−6 4.09 × 10−5
6 × 106 2.05 × 10−6 3.19 × 10−5
Table 8. Ratio Ra,q(N)/Ma,q(N), q = 2k, even N ∈ [106,2 × 106]. Mean, standard deviation, minimum and maximum of the ratio R/M for each modulus q = 2^k and residue a.
Table 8. Ratio Ra,q(N)/Ma,q(N), q = 2k, even N ∈ [106,2 × 106]. Mean, standard deviation, minimum and maximum of the ratio R/M for each modulus q = 2^k and residue a.
q a mean s.d. min max
4 1 0.99740 0.00796 0.945 1.044
4 3 0.99886 0.00753 0.955 1.047
8 3 0.99877 0.01052 0.926 1.074
16 7 0.99986 0.01478 0.896 1.108
32 11 0.99416 0.02217 0.852 1.136
64 5 1.00211 0.03300 0.817 1.201
Table 9. Ratio R a , q ( N ) / M ~ a , q ( N ) on admissible N, general q, even N ∈ [106,2 × 106]. Same statistics as Table 8 for moduli with an odd factor, with the number of admissible N and the largest value of R on non-admissible N.
Table 9. Ratio R a , q ( N ) / M ~ a , q ( N ) on admissible N, general q, even N ∈ [106,2 × 106]. Same statistics as Table 8 for moduli with an odd factor, with the number of admissible N and the largest value of R on non-admissible N.
q a # admissible mean s.d. min max maxRa,q (non-adm.)
3 1 333334 0.99731 0.00563 0.966 1.029 15.9
9 1 333334 0.99759 0.00951 0.938 1.058 15.9
15 2 266667 0.99954 0.00922 0.946 1.054 23.4
20 3 400001 0.99943 0.01283 0.924 1.090 23.4
12 5 333334 0.99885 0.00771 0.955 1.044 15.9
45 2 266667 0.99747 0.01691 0.906 1.077 23.4
Table 10. 𝔖4(p + 1) for the odd primes p ≤ 31. Values of the singular series S4(p+1) together with the odd prime factors of p+1.
Table 10. 𝔖4(p + 1) for the odd primes p ≤ 31. Values of the singular series S4(p+1) together with the odd prime factors of p+1.
p p + 1 odd prime factors of p + 1 𝕾4(p + 1)
3 4 ∅ 1.8659
5 6 {3} 2.2391
7 8 ∅ 1.8659
11 12 {3} 2.2391
13 14 {7} 1.8760
17 18 {3} 2.2391
19 20 {5} 1.9025
23 24 {3} 2.2391
29 30 {3,5} 2.2830
31 32 ∅ 1.8659
Table 11. Statistics of r4(N)/(𝔖4(N)N3/6) over all even N in a window. Mean, standard deviation, minimum and maximum of r4(N)/(S4(N)N^3/6) in three windows of N; the mean approaches 1.
Table 11. Statistics of r4(N)/(𝔖4(N)N3/6) over all even N in a window. Mean, standard deviation, minimum and maximum of r4(N)/(S4(N)N^3/6) in three windows of N; the mean approaches 1.
window mean s.d. min max
[9000,11000] 0.9198 0.0087 0.9040 0.9352
[99000,101000] 0.9760 0.0031 0.9715 0.9804
[198000,200000] 0.9833 0.0022 0.9800 0.9864
Table 12. Certified enclosures of Am(1) and Am(3) (Q = 107). Lower and upper bounds (certified enclosures) of the moments A_m(1) and A_m(3) for m = 1, …, 4.
Table 12. Certified enclosures of Am(1) and Am(3) (Q = 107). Lower and upper bounds (certified enclosures) of the moments A_m(1) and A_m(3) for m = 1, …, 4.
m Am(1)∈ Am(3)∈
1 [1.7427254016, 1.7427257501] [1.1618169344, 1.1618171667]
2 [3.4607371607, 3.4607385450] [1.3842948643, 1.3842954180]
3 [7.6303445889, 7.6303491671] [1.6956321309, 1.6956331482]
4 [18.1823679115, 18.1823824574] [2.1391021072, 2.1391038185]
Table 13. Pearson correlation of 𝔖0(p + 1) and 𝔖0(p − 1) over the primes 3 ≤ p ≤ pN, against the limit ρ∞≈−0.84221. Correlation computed at six scales N (with largest prime p_N), compared with the limiting value.
Table 13. Pearson correlation of 𝔖0(p + 1) and 𝔖0(p − 1) over the primes 3 ≤ p ≤ pN, against the limit ρ∞≈−0.84221. Correlation computed at six scales N (with largest prime p_N), compared with the limiting value.
N pN corr
500 3,571 −0.8431
1,000 7,919 −0.8455
2,000 17,389 −0.8440
5,000 48,611 −0.8436
10,000 104,729 −0.8437
20,000 224,737 −0.8430
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.