Prime patterns

The Prime Constellations

Every star is a prime number. Wherever primes stand at a fixed distance from each other (2 apart, 4 apart, 6 apart, or in tight groups of three to six) a line joins them into a constellation. Fly along the number line and watch them thin out without ever, as far as anyone has looked, running out.

The sky

Drag to fly · pinch, or click the sky and scroll, to zoom · arrow keys work too · click a star or a line to meet its constellation.

How to read this sky

Stars are primes

Each star stands above its number on the ruler: no prime, no star. How high a star floats is decoration only, chosen so the shapes are easy to see. The mathematics is in the distances along the ruler.

Lines are fixed distances

A solid cyan line joins primes 2 apart (twins), a dashed gold line primes 4 apart (cousins), a dotted pink arc primes 6 apart. The filled shapes are groups of 3, 4, 5 or 6 primes packed as tightly as arithmetic allows.

Zoom out to millions

From far away each constellation shrinks to one coloured star. The common families are thinned so the sky stays readable, but every quadruplet, quintuplet and sextuplet is drawn. Below ten million there are only 18 sextuplets.

The constellation that appears only once Proven

3, 5, 7: three primes in a row, each 2 after the last. It never happens again, and you can see why. Slide the first star along and watch which lane each star falls into.

Dividing by 3 leaves remainder 0, 1 or 2. A step of 2 always changes the remainder, and two steps of 2 never bring it back, so the three stars always occupy all three lanes. One of them is therefore a multiple of 3.

The Hardy–Littlewood formula agrees: its constant for this shape is exactly 0.

Which shapes are allowed? Proven

The same test works for any shape and any small prime q. Try every possible remainder of the first star when divided by q. If some other star of the shape would then be a multiple of q, that place on the ring is blocked. A shape with an open place on every ring is called admissible.

open place for the first starblocked: some star would be a multiple

Invent your own pattern and test it in “The Race to the Twin Prime Conjecture” →

How many should there be? Conjecture

Near a large number n, roughly one number in ln n is prime. If the k stars of a shape were independent of each other, a shape would begin at n with a chance of about 1 / (ln n)^k: one factor for each star. They are not independent: the rings above show how the small primes help some shapes and hinder others. In 1923 Hardy and Littlewood packed that correction into one constant S for each shape. Add up the chances for every n up to N, multiply by S, and you have the prediction.

constellations up to N ≈ S · Σn ≤ N 1 / (ln n · ln(n + h₁) ⋯ ln(n + hk−1))

Family Stars k S, published value S, recomputed here Predicted Found ÷ predicted

For mathematicians: statements, status, sources

Definitions

A k-tuple H = (0, h₁, …, h₍ₖ₋₁₎) is admissible if for every prime q its offsets miss at least one residue class mod q. A prime constellation is an admissible k-tuple of the smallest possible diameter: 2 for k = 2, 6 for k = 3, 8 for k = 4, 12 for k = 5, 16 for k = 6. Cousin and sexy pairs are admissible but not of smallest diameter; here they are all pairs (p, p + 4) and (p, p + 6), whether or not other primes lie between them.

The prime k-tuple conjecture Conjecture

Hardy and Littlewood (1923) conjectured the asymptotic below for every admissible H, where ν_H(p) is the number of residue classes mod p occupied by H. It is unproved for every k ≥ 2; even the infinitude of twin primes is open.

#{n ≤ x : n + h ∈ ℙ for all h ∈ H} ∼ 𝔖(H) ∫2x dt / (ln t)k

𝔖(H) = ∏p (1 − νH(p)/p) · (1 − 1/p)−k

What is proved Proven

If H is not admissible, n + H consists of primes for only finitely many n; for (0, 2, 4) and (0, 2, 6, 8, 12, 14) exactly once. The residue rules mod 30 follow from the same argument. Brun (1919): the sum of the reciprocals of the twin primes converges.

Zhang (2013), Maynard, Tao and Polymath8: some gap of at most 246 occurs infinitely often, and for every m infinitely many intervals of bounded length contain m primes. No single shape is known to occur infinitely often.

What is computed on this page Observed

A sieve of Eratosthenes up to 10⁷ runs in a Web Worker. A constellation is counted when all of its members are at most N. The prediction is the sum form S·Σ 1/(ln(n + h₁)⋯ln(n + hₖ)) over the same range of n. It is asymptotic to S·∫₂ᴺ dt/(ln t)ᵏ, but for large k that integral is dominated by the region near t = 2, where the heuristic means nothing: at 10⁷ it would predict 71 sextuplets, the sum form predicts 19, and 18 exist. Each S is recomputed as an Euler product over the primes up to 10⁷ and completed with the tail factor exp(−C(k, 2)·E₁(ln P)). A separate verification program checks the counts, the constants, the predictions and the admissibility tables.

The height of a star is a fixed pseudo-random altitude chosen for legibility and has no arithmetic meaning. In the far view the background primes and the common families are subsampled by index; quadruplets and larger families are always complete.

Sources