WESSEN GETACHEW P1 P2 P3 P4 P5
Analytic Number Theory · Wessen Getachew · 2026
How C(n) Works
A guided walkthrough of the block‑coprime density formula — for anyone who wants to understand what's being plotted on Pages 1–3, not just look at it.
In one sentence: pick two random integers, r and MC(n) tracks (in rescaled form) the chance that r shares no common factor with any of the n+1 consecutive integers starting at M.
$$C(n) \;=\; \zeta(2)\cdot\prod_{p}\left(1-\frac{\min(n{+}1,\,p)}{p^{2}}\right)$$

The picture, plainly

"Coprime" just means sharing no common factorgcd(a,b)=1. Two random integers are coprime about 61% of the time (that famous 6/π² ≈ 0.6079 constant). That's the n = 0 case: one number, one comparison.

Now make it harder. Instead of asking whether r is coprime to a single number M, ask whether it's coprime to the whole block M, M+1, M+2, …, M+n — all n+1 of them, simultaneously. Every extra integer in the block is one more way for r to fail. The density has to drop. C(n) (in its raw form D(n), see below) is exactly that shrinking probability, tracked for every block length.

See it happen

Below is a live r × M lattice, defaulting to the Ring layout used throughout the rest of the site (switch to Grid any time). A point lights up when r is coprime to every integer in the block {M, …, M+n}. Drag n — top bar, panel slider, or Play — and watch the pattern thin out, while the measured density locks onto the formula's prediction.

ALL CANVASES View: Block depth n:
1 Color:
C(1) = ζ(2)·∏ₚ(1 − min(2,p)/p²) ≈ 0.530711
auto-shown whenever grid size G ≤ 40; check to force on above that
grid size G 24 block length n+1 = 2
measured density
D(n) predicted
C(n) = D(n)·ζ(2)

Building the formula, piece by piece

The whole thing is an Euler product — one independent factor per prime, multiplied together. The trick is that a block of n+1 consecutive integers interacts with small primes very differently than with large ones.

1
Split the primes into two camps. For a prime p, ask: is the block {M,…,M+n} long enough to be guaranteed to contain a multiple of p? That happens exactly when the block length exceeds p, i.e. when p ≤ n+1. Call those primes saturated. Every larger prime is active — it may or may not hit the block, depending on where M lands.
2
Saturated primes (p ≤ n+1). Since the block is guaranteed to contain a multiple of p, and r just needs to avoid being a multiple of p itself, the local factor collapses to the ordinary one‑dimensional sieve term: (1 − 1/p). The block length no longer matters here — it already did its job by guaranteeing a hit.
3
Active primes (p > n+1). Now the block is shorter than the prime, so it only catches a multiple of p with probability roughly (n+1)/p. Combine that with r independently avoiding p (probability 1/p), and the joint "bad" probability is about (n+1)/p² — which is exactly where the in the formula comes from. The local factor is (1 − (n+1)/p²).
4
Notice both cases are one formula. min(n+1, p) silently picks the right numerator: it's p for saturated primes (turning p/p² = 1/p) and n+1 for active primes. That's the whole reason the min(·,·) is there — it's a single expression standing in for the two-case product.
5
Multiply every prime's factor together. That product, taken over all primes, is the true, un-rescaled density — call it D(n):
$$D(n)=\prod_{p}\left(1-\frac{\min(n{+}1,p)}{p^{2}}\right)$$
At n = 0 every prime is active (block length 1 never saturates anything), and the product is exactly ∏(1 − 1/p²) = 1/ζ(2) = 6/π² ≈ 0.6079 — the classic two-random-integers constant, right where it should be.
6
Why multiply by ζ(2) at all? That last step, C(n) = ζ(2)·D(n), is a bookkeeping choice, not a new probability. It rescales things so that the baseline case (n = 0, just plain coprimality) reads exactly C(0) = 1. Everything you see on Page 1 as "how far C(n) has fallen from 1" is then a direct read of how much the block condition costs you beyond ordinary coprimality — which is a more legible story than staring at raw probabilities like 0.6079, 0.5307, 0.4931… C(n) is the same information, just normalized to start at 1.

Worked example — n = 1 (block length 2)

Take the smallest nontrivial case: is r coprime to both M and M+1? Block length is 2, so the saturation cutoff is p ≤ 2 — only p = 2 is saturated.

Reading the live table

Move the n slider at the top of the page and watch this table update — it's the same split you just walked through, computed live.

quantityvalue

Full working — every prime, nothing left out

The table above summarizes; this one shows the entire Euler product prime by prime, exactly the way it's actually computed — toggle between decimal and exact fraction, click any row to see the substitution worked out, and watch the running product converge on C(n).

Show full working prime-by-prime Euler product · decimal or fraction
Display:
Primes:

Why does the pattern repeat?

A reader on the original post asked about a self‑similar, repeating pattern that seemed to "scale at some frequency" in the lattice views. It's not connected to the zeta function's zeros or anything spherical — it's much more down‑to‑earth, and it falls straight out of the sieve structure above.

Whether a cell (r, M) lights up depends only on r and M modulo small primes — divisibility by 2 repeats every 2 integers, by 3 every 3, by 5 every 5, and so on. Once you've accounted for every saturated prime up to n+1, the whole coprimality pattern repeats exactly with period 2·3·5·7·… — the primorial of those primes. That's the "unknown frequency": it isn't unknown at all, it's the product of the small primes below the block length, and it grows combinatorially (2, 6, 30, 210, 2310, …) rather than smoothly, which is exactly what makes the self‑similarity look like it's "scaling" as you zoom — each new saturated prime multiplies the repeat period by that prime. This is the same mechanism behind the classic Sieve of Eratosthenes visualizations and Stern–Brocot / Farey self‑similarity elsewhere on this site (Page 1's Farey and Ford‑circle views included).

← Page 1 · full explorer Page 2 · Gap Diagonal Identity Page 3 · Color & label modes