TITLE: Why is there an unexpected increase in the density of certain types of Goldbach primes?
QUESTION [8 upvotes]: Note: Posted in MO since it was unanswered in MSE.
I was checking how quickly we can verify Goldbach's conjecture for a given even number $n$ and it was clear that searching backward starting from the largest prime below $n$ was much faster than a forward search starting from the small odd prime $3$. I observed the following.
Consider the set of even numbers $n$ which can be written as the sum of two primes and $p$ be the largest prime less than $n$ such that $n-p$ is also a prime. Let $p_k$ be the $k$-th prime. Then, $p_{\pi(n)-2}$, $p_{\pi(n)-1}$ and $p_{\pi(n)}$ are the three largest primes preceding $n$. Now $p$ can either be the largest prime below $n$, or the prime just before the largest prime or the prime before that and so on. Accordingly, we define:

$d_1$ is the density of $n$ such that $p = p_{\pi(n)}$
$d_2$ is the density of $n$ such that $p = p_{\pi(n)-1}$
$d_3$ is the density of $n$ such that $p = p_{\pi(n)-2}$

Data for $n \le 3 \times 10^{10}$ shows that $d_1$ and $d_2$ decreased as $n$ increased. This was intuitively expected as explained in the answer for the related question "If $p$ is the largest prime less than $2n$, what is the probability that $2n-p$ is a prime?". However, quite counter intuitively, $d_3$ increased with $n$ as shown in the graphs below.
Question 1: Why does $d_3$ increase with $n$ while $d_1$ and $d_2$ decreased?
Question 2: What is the limiting value of $d_3$? Since $d_3 < 1$ and is increasing, it must converge to a positive limiting value.
Note: I have not computed $d_k$ for $k \ge 4$ so I do not know if this increasing trend is observed other values of $k$.
Graphs in normal scale

REPLY [4 votes]: Here are  a few thoughts.
First, $d_i$ is not the density of a certain type of prime, it is the density (as you say) of a certain type of even integer. So let me abuse notation and say that an even integer $n$ is of type $c_i$ if $q=n-p_{\pi(n)+1-i}$ is prime and type $d_i$ if, in addition, its farthest spaced Golbach pair is $n=q+p_{\pi(n)+1-i}.$
That the apparent increase you see in $d_3$ eventually goes away has been explained convincingly by others. I wanted to suggest why it might take a very very long time.
To oversimplify dramatically,  $0<d_3(x)<c_3(x)$ and $c_3(x) =O(\frac1{\ln \ln x}).$ This squeezes $d_3$ to zero, but rather gently. Actually, $c_1(x)$ and  $c_2(x)$ should all have roughly the same magnitude.
To oversimplify somewhat less, the density and pattern of type $d_1$ for even integers the size of $x$ depends on the primes of size up to about $\ln(x).$ These even integers separate into those in the intervals between two primes $p$ and $p+g.$ In such an interval $g$ is on average about $ln(x)$ while the number of type $d_1$ is $\pi(g)-1$ and the pattern is exactly that of the odd primes up to $g.$
Around $10^{10},2\cdot 10^{10}$ and $3 \cdot 10^{10}$ the average gap $g$ between primes takes the values approximately $23,23.7$ and $24.1.$ It is these gaps, specifically the triples which occur,  and the specific primes the size of the gaps which control what happens.
Consider four consecutive primes $$p_{m-3},p_{m-2},p_{m-1},p_m=q,q+g_3,q+g_3+g_2,q+g_3+g_2+g_1$$  Then, for the $\frac{g_1}2$ even integers in the range $S=(p_{m-1},p_{m})$, the pattern of which are type $d_1,d_2,d_3$ (or none of these) does not depend on $q$, it depends completely on that triple of gaps $g_3,g_2,g_1$ and the particularities of the odd primes up to $g_1+g_2+g_3.$  More specifically, the primes in these three subintervals:
$I_1=[0,g_1],\ I_2=[g_2,g_2+g_1]$ and $I_3=[g_3+g_2,g_3+g_2+g_1]$ .
Let $\mathcal{P}$ be the odd primes and

$S_1=\{q+g_3+g_2+i \mid i \in I_1 \cap \mathcal{P}\}$

$S_2=\{q+g_3+i \mid i \in I_2 \cap \mathcal{P}\}$

$S_3=\{q+i \mid i \in I_3 \cap \mathcal{P}\}$


The even $n$ ( from $S$ ) of type $d_1$ are exactly those in $S_1.$ Those of type $d_2$ are exactly those in $S_2 \setminus S_1$ and for $d_3,$ $S_3\setminus (S_1 \cup S_2).$
There will always (everyone believes) be triples with these specific gaps $g_3,g_2,g_1,$ but the frequency will decrease to be replaced more often by triples with somewhat larger $g.$ The rate at which this change happens will be exceedingly slow.
Here are some small calculations which  are insufficient to do more  than suggest that a much larger range would be needed to see meaningful changes in behavior.

For $101$ consecutive primes starting shortly after $10^{10}$ the difference between the first and last is $2500$ and the frequency of gaps are:
$[[6], 15], [[18], 9], [[4, 12], 8], [[26], 7], [[8, 14, 30, 42], 4], [[28, 48], 3], [[2, 10, 16, 20, 32, 36, 40, 46, 52, 70, 120], 2], [[22, 24, 34, 44, 50, 54, 60, 66, 92], 1]$

So the gaps $4$ and $12$ occur $8$ times each.

For $101$ consecutive primes starting shortly after $2\cdot 10^{10}$ the difference between the first and last is $2232$ and the frequency of gaps are:
$[[6], 12], [[10, 12], 9], [[8], 7], [[2, 18], 6], [[22, 24], 5], 
  [[4, 14, 30], 4], [[32], 3],   [[20, 26, 36, 38, 40, 42, 50, 52, 90], 2], 
  [[34, 46, 48, 58, 60, 70, 76, 88], 1]$

For $101$ consecutive primes starting shortly after $3\cdot 10^{10}$ the difference between the first and last is $2566$ and the frequency of gaps are:
$ [[12], 11], [[4, 6, 18], 8], [[24], 7], [[20], 5],    [[10, 16, 26, 42, 60], 4], [[8, 14, 30], 3],       [[2, 28, 32, 34, 36, 48, 70], 2],        [[22, 38, 40, 44, 54, 56, 74, 92, 94, 156], 1]$


In the end, I'm not really sure how much this explains. It is merely a suggestion of a place to look. For a stab at the kind of consideration that might arise: The even integers are sectioned off into intervals $[p,p+g]$ where $g$ is the gap from the prime $p$ to the next prime. The local density  $d_1$ is $\frac{2(\pi(g)-1)}{g}$
(since there are $\frac{g}2$ even integers and the prime $2$ is not odd.) In those cases where $g$ is $24,26,28$ the local density is $\frac{16}{g}.$ To the extent that $g=28$ occurs more often and $g=24$ less often, the contribution to the growth  of $d_1$ is less. This, in turn, gives more chances for $d_3$ to grow. For $g=30$ the local density is $\frac{18}{30}>\frac{16}{28}$ which retards that (tiny) effect ever so slightly. Of course there are many other considerations.

Two other comments:
I find the question interesting but the stated motivation unconvincing. Given an even $n$ you want to find one representation of it as a sum of two primes. So you suggest checking $n-3$ and, if that is not prime working down through the odd integers $q$ (not congruent to $n \bmod 3$) and , when one is prime, checking if
$n-q$ is. It might be faster, for $n \equiv 2 \bmod 6,$ to check $n-3$ and then $n-7,n-13,n-19,n-31,n-37,n-43,n-61$ (though one would need to know when to stop)
You might find it helpful to study $n \equiv 0 \bmod 6$ vs $n  \equiv \pm 2 \bmod 6.$ What does the trend of the densities  $d_1,d_2,d_3$ look like in each type? I'd expect $n \equiv 0 \bmod 6$ to be perhaps only $1/3$ as likely to be counted by $d_3$ as other even $n:$ Suppose $p\ \equiv 1 \bmod 3$ is a prime. Given only this information, of the even $n$ up to the next prime, those of the form $6m$ could be counted by $d_1,d_2$ or $d_3$  but those of the form $6m + 2$ could possibly be counted by $d_2$ or $d_3$ but not $d_1$.
It might be that these kinds of effects balance out.