$$\text{coprime density on } |M - r| = g \;=\; \frac{\varphi(g)}{g}$$
diagonal g = — density — = drag g slider ↓
2ⁿ preset:
Grid G8Diagonal goffDepth n0ColorRing ω1.0×Zoom1×
—
Selected point
Grid G8
Diagonal g—
φ(g)—
φ(g)/g theory—
Coprime / Total on diag—
Observed density—
Depth n0
Block diag density—
Geometric Theorem: The Gap Diagonal Identity
New · 2026
Consider the integer lattice of pairs $(r, M)$ with $1 \le r, M \le G$.
A cell is coprime if $\gcd(r, M) = 1$.
Fix any anti-diagonal defined by $|M - r| = g$.
$$\text{coprime density on } \{|M - r| = g\} \;=\; \frac{\varphi(g)}{g}$$
This holds for any $g \ge 1$ and any $G \ge g$, uniformly — independent of the grid size.
Euler's totient function $\varphi$ is literally the coprime density of a diagonal stripe in the integer lattice.
g = 1
1.000
φ(1)/1 = 1/1 · all pairs coprime
g = 2
0.500
φ(2)/2 = 1/2 · half the diagonal
g = 6
0.333
φ(6)/6 = 2/6 · every third
g = 12
0.333
φ(12)/12 = 4/12 · same ratio
Proof Sketch
On the diagonal $|M - r| = g$, every cell has the form $(r, r + g)$ for $r \ge 1$.
The cell is coprime iff $\gcd(r, r+g) = 1$. Since $\gcd(r, r+g) = \gcd(r, g)$, we need $\gcd(r, g) = 1$.
$$\gcd(r,\, r+g) \;=\; \gcd(r,\, g)$$
The proportion of $r \in \{1, \ldots, g\}$ with $\gcd(r,g) = 1$ is exactly $\varphi(g)/g$.
The diagonal repeats with period $g$, so every window of $g$ consecutive cells contains exactly $\varphi(g)$ coprime ones.
The density is therefore $\varphi(g)/g$ for any $G$. $\square$
Step 01Parametrize the diagonal▶
The anti-diagonal $|M - r| = g$ consists of pairs $(r, r+g)$ for $r = 1, 2, \ldots, G-g$ (and symmetrically $(r+g, r)$). We focus on one sheet; the other is identical by symmetry.
Step 02Reduce the coprimality condition▶
A cell $(r, r+g)$ is coprime iff $\gcd(r, r+g) = 1$. By the Euclidean algorithm, $\gcd(a, b) = \gcd(a, b-a)$, so $\gcd(r, r+g) = \gcd(r, g)$. The condition simplifies to $r \perp g$.
Step 03Count via periodicity▶
The function $r \mapsto \gcd(r,g)$ has period $g$. In each block of $g$ consecutive integers, exactly $\varphi(g)$ are coprime to $g$. As $r$ runs over the diagonal, this pattern repeats perfectly, giving density $\varphi(g)/g$ independent of $G$.
Step 04Exact for all G ≥ g▶
The diagonal has $G - g$ cells. Since the period-$g$ pattern tiles perfectly, the boundary error is at most $g - 1$ cells, giving observed density within $O(g/G)$ of the exact value $\varphi(g)/g$. In practice, for $G \gg g$ the identity is exact to many decimal places.
Extension to Block-Coprimality — The C(n) SettingExtension
For a fixed depth $n \ge 0$, a cell $(r, M)$ is block-coprime if $\gcd(r, M+j) = 1$ for all $j = 0, 1, \ldots, n$.
On the diagonal $|M - r| = g$, this reduces to: $\gcd(r, g+j)=1$ for all $j=0,\ldots,n$.
$$\text{coprime density on } |M-r|=g \text{ at depth } n \;=\; \prod_{p \mid g(g+1)\cdots(g+n)} \!\!\left(1 - \frac{1}{p}\right)$$
n=0φ(g)/g
n=1∏p|g(g+1)(1−1/p)
n→∞→ C(∞) = 0
g
Window {g,…,g+n}
Primes in product
Diagonal density (n=1)
1
{1, 2}
2
1/2 = 0.5000
2
{2, 3}
2, 3
1/2 · 2/3 ≈ 0.3333
4
{4, 5}
2, 5
1/2 · 4/5 = 0.4000
6
{6, 7}
2, 3, 7
1/2 · 2/3 · 6/7 ≈ 0.2857
Why This Matters
01New sieve interpretation: Sliding $g$ selects which local window of integers you test. The diagonal is a sieve window selector.
02C(n) as a diagonal average: The global block-coprime density $C(n)$ is the average of diagonal densities: $C(n) \approx \tfrac{1}{G}\sum_{g} d_n(g)$.
03Prime constellation heuristics: Recasting admissibility as a geometric exclusion pattern in the lattice opens a new visual approach to prime constellation density.
4K Export
Exports a 3840 × 3840 square PNG — always square — with the current grid state, a title header, colored legend, and all parameters labeled. The canvas uses the sector color scheme for maximum visual richness.
Rendering…
The One-Line Form
"Euler's $\varphi(g)/g$ is not just a formula — it is the coprime density on the anti-diagonal $|M-r|=g$ of the integer lattice."
— Wessen Getachew, 2026 · wessengetachew.github.io
3D Coprime Lattice — Joint Coprimality in $\mathbb{Z}^3$
A point $(x, y, z)$ is lit when $\gcd(x, \gcd(y, z)) = 1$ — i.e., no prime divides all three coordinates simultaneously. The density of such triples is $\zeta(3)^{-1} \approx 0.8319$ (Apéry's constant reciprocal).
At $2^n$ grid sizes the outer boundary face locked at $Z = 2^n$ reduces to a strict parity check, producing a perfect 3D checkerboard where every lit block is surrounded on all six sides by dark blocks. The interior carves prime-number tunnels straight through the volume.
The Vault Analogy — Biology Meets the Coprime Lattice
⬡
Vault ribonucleoprotein particles are barrel-shaped cytoplasmic complexes (~13 MDa, 35 × 65 nm) first isolated in 1986. Under acidification (increasing H⁺ concentration), vaults undergo a reversible conformational change: the barrel splits equatorially into two half-vaults, exposing the internal structure. The proton field drives the separation by protonating charged residues, reducing the cohesion across the equatorial hinge.
The coprime lattice $G_M(r, M) = \mathbf{1}[\gcd(r, M) = 1]$ over the square $\{1, \ldots, G\}^2$ has a natural equatorial division: the main diagonal $r = M$ is the hinge, separating the upper sector $\{M > r\}$ from the lower sector $\{M < r\}$. The diagonal itself is always non-coprime for $r > 1$ (since $\gcd(r, r) = r$), forming a dark seam — exactly like the equatorial belt of the vault.
Biology (Vault)
Mathematics (Coprime Lattice)
Two half-vaults
Upper sector {M > r} · Lower sector {M < r}
Equatorial hinge
Main diagonal r = M (gcd(r,r) = r)
Proton field H⁺
Diagonal gap g = |M − r| (the splitting parameter)
Conformational opening
Sector separation as split → 1
Internal RNA exposure
Diagonal density φ(g)/g revealed on each strip
Symmetric capsid structure
G_M(r,M) = G_M(M,r) (symmetry of gcd)
Density Field — Local Coprime Density as a Scalar Field
The Density Field mode computes at each lattice point $(r, M)$ the fraction of coprime pairs within a square kernel of radius $R$:
$$D_R(r, M) \;=\; \frac{1}{(2R+1)^2} \sum_{\substack{|r'-r|\le R \\ |M'-M|\le R}} \mathbf{1}[\gcd(r',M')=1]$$
The global average converges to $6/\pi^2 \approx 0.6079$ (the Mertens density). However, the field is not uniform: density is lower near the diagonal $r = M$ (where gcd$(r,r)=r$ forces non-coprimality) and varies systematically across anti-diagonals, with density on the strip $|M-r|=g$ equal to $\varphi(g)/g$.
The Gradient Flow mode visualizes $\nabla D_R$, the vector field pointing in the direction of steepest density increase. These flow lines reveal how coprime density "drains" toward the diagonal and "pools" in prime-rich regions.
global mean6/π² ≈ 0.6079
diagonal r=Mdensity → 0 (gcd=r≥2)
strip g=|M−r|φ(g)/g
strip g=1φ(1)/1 = 1.000
strip g=2φ(2)/2 = 0.500
strip g=6φ(6)/6 = 0.333
Field Symmetries and Topology
The density field $D_R(r,M)$ inherits the symmetries of $\gcd$: it is symmetric ($D_R(r,M) = D_R(M,r)$) and satisfies the approximate reflection $D_R(r,M) \approx D_R(G-r, G-M)$ by equidistribution. The vault split animation makes visible the triangular decomposition of the lattice, whose boundary identification theory (torus vs. Klein bottle) was explored in the companion LaTeX note.