C(n)
Page 2
Gap Diagonal Identity ← Main Page Hub ↗
Analytic Number Theory · Wessen Getachew · 2026

Gap Diagonal Identity

$$\text{coprime density on } |M - r| = g \;=\; \frac{\varphi(g)}{g}$$
diagonal   g = —   density    =   drag g slider ↓
2ⁿ preset:
Grid G 8
Diagonal g off
Depth n 0
Color
Ring ω 1.0×
Zoom
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=1p|g(g+1)(1−1/p)
n→∞→ C(∞) = 0
gWindow {g,…,g+n}Primes in productDiagonal density (n=1)
1{1, 2}21/2 = 0.5000
2{2, 3}2, 31/2 · 2/3 ≈ 0.3333
4{4, 5}2, 51/2 · 4/5 = 0.4000
6{6, 7}2, 3, 71/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
← C(n) Explorer Hub ↗