TITLE: Some interesting experimental results about the distribution of primes
QUESTION [7 upvotes]: Let's consider the following metric of the gap between consecutive primes
$$m(k)=\frac {p_k^2-p_{k-1}^2} {24}\;\;\;\;\;(k\ge4)$$
Now, let's define the function
$\delta(k)=m(k)\;\;\;\;$ if $\,m(k)\,$ is prime $\;\;\;\;(1)$
$\delta(k)=0\;\;\;\;\;\;\;\;\;\;$ otherwise $\,\;\;\;\;\;\;\;\;\;\;\;\;\;(2)$
If we plot the graph of $\,m(k)\,$ we obtain (up to $\,k=10^4$):

But, if we plot the graph of $\,\delta(k)$, we obtain something completely different (up to $\,k=10^4$):


In the second graph the three different increasing curves seem to have
  the following asymptotic behaviors:
$$\sim \frac {p_k} {2}$$
$$\sim \frac {p_k} {3}$$
$$\sim \frac {p_k} {6}$$
Further, the prime numbers are not uniformly distributed among the three curves. The number of primes decreases passing from the highest
  to the lowest curve (I'm trying to estimate the number of primes that fall on each curve).
I do not have adequate knowledge of analytic number theory to
  explain the phenomenon, therefore I ask for your help.

Many thanks.

REPLY [14 votes]: Assume that $k\geq 5$ and $m(k)$ is prime. Observe the factorization
$$\frac{p_k-p_{k-1}}{2}\cdot\frac{p_k+p_{k-1}}{2}=6m(k).$$
On the left hand side, the second fraction is greater than $6$, hence the first fraction is smaller than $m(k)$. So the first factor is relatively prime to $m(k)$, whence it divides $6$. So $p_k-p_{k-1}$ equals $2$ or $4$ or $6$ or $12$.

If $p_k-p_{k-1}=2$, then $m(k)=(p_k+p_{k-1})/12\sim p_k/6$.
If $p_k-p_{k-1}=4$, then $m(k)=(p_k+p_{k-1})/6\sim p_k/3$.
If $p_k-p_{k-1}=6$, then $m(k)=(p_k+p_{k-1})/4\sim p_k/2$.
If $p_k-p_{k-1}=12$, then $m(k)=(p_k+p_{k-1})/2$, which is a contradiction, because there is no prime between $p_k$ and $p_{k-1}$.

This explains the "three increasing curves" $p_k/6$, $p_k/3$, $p_k/2$. The density of these three cases (i.e. the validity of two linear equations in the three primes $p_k$, $p_{k-1}$, $m(k)$) is heuristically known, see e.g. Conjecture 1.2 in Green-Tao: Linear equations in primes.