# Prime gap distribution in residue classes and Goldbach-type conjectures

Update on 7/20/2020: It appears that conjecture A is not correct, you need more conditions for it to be true. See here (an answer to a previous MO question).

The general problem that I try to solve is this: if $$S$$ is an infinite set of positive integers, equidistributed in a sense defined here, and large enough as defined in the same post, then all large enough integers can be written as the sum of two elements of $$S$$. I call this conjecture A, and the purpose of my previous question (same link) was to find whether this is a conjecture, a known fact, or not very hard to prove.

Here I try to solve what I call conjecture B. Let $$p_k$$ be the $$k$$-th prime ($$p_1 = 2$$) and $$q_k = (p_{k} + p_{k+1})/2 = p_{k} + g_{k}$$ where $$g_{k} =(p_{k+1}-p_{k})/2$$ is the half-gap between $$p_{k}$$ and $$p_{k+1}$$. Let $$S_1$$ be the set of all the $$q_k$$'s, for $$k=2,3,\cdots$$. Is $$S_1$$ equidistributed in the same sense, that is equidistributed in all residue classes? For this to be true, it suffices to prove that the half-gaps are equidistributed in residue classes. There is an attempt to answer that question here, but it is not clear to me if the answer is yes, no, or unsure. What is your take on this?

Assuming conjectures A and B are true, then any large enough integer is the sum of two elements of $$S_1$$. Another interesting result is this: let $$S_2$$ be the set of all $$\lfloor \alpha p_k\rfloor$$ where the brackets represent the floor function, $$k=1,2,\cdots$$, and $$\alpha > 0$$ is an irrational number. Then any large enough integer is the sum of two elements of $$S_2$$.

The interesting thing about $$S_2$$ is that it is known to be equidistributed and furthermore, you can choose $$\alpha=1+\epsilon$$ with $$\epsilon$$ an irrational number as close to zero as you want, but NOT exactly zero. Since $$\lfloor(1+\epsilon)p_k\rfloor = p_k + \lfloor \epsilon p_k\rfloor$$, if conjecture A is true you have this result:

Any large enough integer $$n$$ can be written as $$n=p + q + \lfloor \epsilon p\rfloor + \lfloor \epsilon q\rfloor$$, with $$p, q$$ primes and $$\epsilon>0$$ an irrational number as close to zero as you want (but not zero).

With $$\epsilon=0$$, this would be equivalent to Goldbach conjecture, but of course it does not work with $$\epsilon=0$$ since no odd integer $$n$$ is the sum of two primes, unless $$n=p+2$$ and $$p$$ is prime.

Two useful references

Provided by Andrew Granville, who also mentioned the following.

As to your question the answer is a little surprising and has been the subject of some recent publicity - there are two papers by Robert Lemke Oliver and Soundararajan who look at how often one has $$p_n= a \bmod{q}$$ and $$p_{n+1} = b \bmod{q}$$. Turns out these counts are far from uniformly distributed though an analysis via the circle method reveals that they should be asymptotically the same, but there is a large secondary term which plays a significant role as far as one can ever hope to compute.

Finally, I will try to prove that if $$S$$ is equidistributed in residue classes, then $$S+S$$ is also equidistributed. I posted this as a question on MSE, here.

• Your conjectured result, if true, would be up to $O(1/\epsilon)$, no? – Sylvain JULIEN Jul 14 '20 at 17:51
• Yes, unfortunately the closer to zero you get, my obvious guess is that the exception set (numbers that can not be represented that way) even though finite, would be extremely large. – Vincent Granville Jul 14 '20 at 18:00
• A first step to prove conjecture A might be this: prove that if $S$ is equidistributed, then $S+S=\{x,y$ with $x,y \in S\}$ is also equidistributed. – Vincent Granville Jul 14 '20 at 18:02

Here I provide some insights about conjecture B. First, it is still a conjecture, and just like the paradox that I discussed here, it defies empirical evidence: the error term in the approximation involves $$\log$$ and $$\log \log$$ functions (see here) so you would need to use insanely large numbers to see convergence to uniform distribution in residue classes, for all moduli $$m$$. In particular, if you look "only" at the first million elements of $$S_1$$,
• If $$m>0$$ is a multiple of $$3$$, then $$q_k = 0, 3, 6,\cdots \bmod{m}$$ far more often than expected.
• If $$m>0$$ is a multiple of $$3$$, then $$q_k = 1 \bmod{m}$$ far less often than expected.
Yet if $$m>2$$ is prime, then the discrepancies tend to disappear much faster. In that case $$q_k = r \bmod{m}$$ much more frequently for $$r=0$$, and less frequently for $$r=1,\cdots,m-1$$. The case $$r=0$$ is the worst discrepancy. The table below summarizes the discrepancy at $$r=0$$ when $$m$$ is prime ($$m=3, 5,\cdots, 23$$):
A number such as $$1.7037$$ means that for the prime $$m$$ in question (in this case $$m=3$$) we have $$q_k = 0 \bmod{m}$$ about 1.7073 times more than expected, among the first million elements of $$S_1$$.