0
$\begingroup$

It is well known that there is a little bias in the distribution of prime residues modulo 4. But the bias eventually vanishes. I looked at the first million primes, and the counts are as follows:

  • 499798 have residue 1
  • 500201 have residue 3

A much more striking bias is about the autocorrelation, and successive runs in the value of the residue. They appear to not be distributed as if produced via a random sequence.

Question

I am wondering if this bias also vanishes when considering much longer sequences, whether it has a simple explanation, or if there is any literature on the subject. I've found this article, but not sure it addresses this issue.

Results of my computations

Let $x_k = \bmod(p_k, 4)$ where $p_k$ is the $k$-th prime. Let $y_k=x_{k+1}$. The empirical correlation between $(x_k)$ and $(y_k)$ is around $-1/8$ for the first million primes. Higher auto-correlations (lag-2, lag-3 and so on) are closer to zero. Also the bias seems stronger for smaller primes.

If you look at runs of length 1, 2, and so on in the sequence $(x_k)$, it is skewed in favor of shorter runs. For instance, $56.26\%$ are of length 1, a significant departure from the expected value $50\%$, and much stronger than the bias mentioned above for raw counts of $x_k=1$ versus $x_k=3$. It means that $x_k$, more often than not, is different from $x_{k-1}$.

Finally Let $z_k=(x_k-2)+z_{k-1}$ the random walk associated with the sequence $(x_k)$. Its graph is plotted below, with $k$ on the X-axis and $z_k$ on the Y-axis:

enter image description here

I conjecture this kind of Brownian motion crosses the X-axis infinitely many times.

$\endgroup$
2
  • 3
    $\begingroup$ There was a few years ago a series of articles about a shocking "pattern" in primes found, I believe somewhat similar to what you're discussing but in base $10$ instead. The Math SE Mathematicians shocked(?) to find pattern in prime numbers post discusses this. $\endgroup$ Commented Nov 11, 2021 at 18:58
  • 3
    $\begingroup$ See arxiv.org/abs/1603.03720 which discusses such problems for consecutive primes $\pmod q$ for any $q$. $\endgroup$
    – Lucia
    Commented Nov 11, 2021 at 21:49

0

You must log in to answer this question.