Primearium Lab · last digits of consecutive primes
Do primes have memory?
Every spark is a prime jumping from its ending to the ending of the next prime. If primes were random, all the flows would be equally thick. They are not: a prime rarely repeats the ending of the prime before it.
Ring segments are the possible endings (remainders). Ribbon width: how often an ending is followed by another. The small petals are repeats.
Why would a prime remember anything?
But the next prime is usually close
To repeat an ending, say 1 → 1 in base 10, the gap to the next prime must be a multiple of 10: at least 10. To go 1 → 3 a gap of 2 is enough. Short gaps are more common than long ones, so changing the ending usually wins. In base 30 the shortest step from every ending leads to the next one in the cycle 1 → 7 → 11 → 13 → 17 → 19 → 23 → 29 → 1, and that is exactly the brightest ring of flows.
It fades, very slowly
The transition matrix
Real primes
Random model
The honest twist
Fake primes remember too
The random model (second ring) contains no real primes at all. It takes the numbers not divisible by 2, 3, 5, 7 or 11 and keeps each one by a coin flip with probability (2310 / 480) / ln n, so that it is exactly as dense as the primes. Nothing else. Its rings look almost the same: the “memory” is mostly sieve geometry (which gaps are possible) plus the fact that gaps are short. Only small differences are left for the deeper arithmetic of the primes.
How the memory fades as numbers grow
For mathematicians
exact statements, what is proven, the data
What is proven
Proven Dirichlet (1837) and the prime number theorem for arithmetic progressions: for gcd(a, q) = 1, π(x; q, a) ~ li(x) / φ(q). Each ending has limiting share 1 / φ(q).
Proven Shiu (2000): for any a coprime to q and any k there are infinitely many runs of k consecutive primes all ≡ a (mod q). Repeats are rare, never impossible. That the pair frequencies π(x; q, (a, b)) tend to 1 / φ(q)² is not proven.
The Lemke Oliver - Soundararajan conjecture (2016)
Conjecture From the Hardy-Littlewood prime k-tuples conjecture they derive, for consecutive primes pn ≡ a, pn+1 ≡ b (mod q):
π(x; q, (a, b)) = li(x) / φ(q)² · ( 1 + c₁(q; a, b) · ln ln x / ln x + c₂(q; a, b) / ln x + … )
with c₁(q; a, b) = 1/2 − φ(q)/2 if a ≡ b and 1/2 otherwise. So every pair tends to 1/φ(q)², but repeats are penalised by a term that decays only like ln ln x / ln x. The second-order coefficient c₂ distinguishes the different b ≠ a (for example the cycle in base 30) and is not small at computable heights: the first-order curve in the chart predicts a weaker bias than observed.
The random model
A Cramér-type model sharpened by a wheel (in the spirit of Granville's refinement): the true primes 2, 3, 5, 7, 11, then every n > 11 with gcd(n, 2310) = 1 is kept independently with probability min(1, (2310/480) / ln n). It knows the local factors for the primes up to 11 and the size of gaps, nothing more. It is a heuristic for comparison, not a theorem; the remaining differences (for instance in the base-30 cycle) involve the primes 13, 17, ... and the Hardy-Littlewood singular series.
What we measured
Exact counts. Each consecutive pair (p(n), p(n+1)) is assigned to the decade of p(n); primes dividing the modulus are skipped. Random model: seed 20161, one fixed run.
Up to 107 this page recomputes everything live in your browser (sieve and model in a Web Worker). We counted the larger decades with a segmented sieve, using the same model and random generator. A separate verification program compares the two implementations over the range they both cover.
References
- R. J. Lemke Oliver, K. Soundararajan, Unexpected biases in the distribution of consecutive primes, PNAS 113 (31) (2016), E4446–E4454. arXiv:1603.03720
- D. K. L. Shiu, Strings of congruent primes, J. London Math. Soc. (2) 61 (2000), 359–373.
- P. G. L. Dirichlet (1837), primes in arithmetic progressions; see H. Davenport, Multiplicative Number Theory, Springer.
- H. Cramér, On the order of magnitude of the difference between consecutive prime numbers, Acta Arith. 2 (1936), 23–46.
- A. Granville, Harald Cramér and the distribution of prime numbers, Scand. Actuarial J. 1995, 12–28.
- G. H. Hardy, J. E. Littlewood, Some problems of “Partitio numerorum” III, Acta Math. 44 (1923), 1–70.
- E. Klarreich, Mathematicians Discover Prime Conspiracy, Quanta Magazine, March 2016.
- OEIS A000040 (the primes), A001223 (gaps between consecutive primes).