Max length L 6.50
Prime geodesics π_g(L) —
Law e^L / L —
Primes π(⌊e^L⌋) —

Click any glowing arc to highlight its orbit and matrix

How it works

Why curved loops count like prime numbers

A curved world tiled like Escher

Inside the Poincaré disk, distance stretches near the rim so the edge lies infinitely far away. Straight paths (geodesics) are circular arcs meeting the boundary at right angles. The modular group PSL(2, Z) tiles the disk with identical curved triangles; gluing matching triangles turns the whole disk into one compact-like curved world with a single spike (the modular surface).

Indivisible loops are geometric primes

A ray launched along a special direction returns to its exact starting point and heading, forming a closed geodesic. If it does not simply trace a shorter loop twice or three times, it is primitive — just as a prime number cannot be built by multiplying smaller numbers. Each primitive loop corresponds to a matrix of trace t ≥ 3 and has exact length ℓ = 2 arccosh(t/2).

Two different universes, one law

Set x = eL so each loop's exponential length N(P) = eℓ plays the role of a prime number p. Then the count of primitive loops of length at most L behaves like eL / L — the exact mirror of Gauss and Hadamard's law π(x) ~ x / ln x for ordinary prime numbers.

Side-by-side comparison

Prime geodesic theorem beside the prime number theorem

Both charts share the exact same horizontal scale (L = ln x) and identical vertical range. Drag the length slider above to watch both worlds march together.

Curved space: Prime Geodesic Theorem

Exact count πg(L) of primitive closed geodesics vs eL / L and Li(eL)

Whole numbers: Prime Number Theorem

Exact count π(eL) of primes up to x = ⌊eL⌋ vs x / ln x and Li(x)

Prime geodesics π_g(L)
—
Primes π(⌊e^L⌋)
—
e^L / L (= x / ln x)
—
Offset Li(e^L)
—
π_g(L) / (e^L / L)
—
π(⌊e^L⌋) / (e^L / L)
—

Exact length spectrum of PSL(2, Z)

Click any trace row to highlight a primitive geodesic of that length on the disk. Notice traces such as t = 7, 14, and 18 where repeated powers of shorter loops are subtracted from H(t) to obtain P(t).

Trace t Length ℓ t² − 4 All H(t) Primitive P(t) Cumulative π_g(ℓ)
For mathematicians: exact statements, class numbers & references

Proven

Prime Geodesic Theorem on the modular surface

Proven

Length spectrum & narrow class numbers of binary quadratic forms

A hyperbolic matrix γ = [[a, b], [c, d]] ∈ SL(2, Z) of trace t = a + d ≥ 3 has translation length ℓ = 2 arccosh(t/2) and corresponds bijectively (up to proper SL(2, Z)-equivalence) to the indefinite binary quadratic form Qγ(x, y) = c x² + (d − a) xy − b y² of discriminant t² − 4. Grouping forms by content u = gcd(A, B, C) gives the exact total multiplicity H(t) = ∑ h+((t² − 4)/u²) over all u² | (t² − 4) with D = (t² − 4)/u² ≡ 0, 1 (mod 4), where h+(D) is the narrow class number of primitive forms. Primitive counts P(t) follow by Möbius/Chebyshev inversion H(t) = ∑Tk*(t0)=t P(t0), with T1*(t) = t, T2*(t) = t² − 2, Tk+1* = t Tk* − Tk−1*. Note that u > 1 can still yield primitive classes (e.g. t = 6, u = 2, D = 8 gives R²L² = [[5,2],[2,1]], whose square root has determinant −1) (Gauss; Sarnak 1982).

Proven

Symbolic dynamics via {R, L} cutting sequences

Because PSL(2, Z) ≅ Z/2 * Z/3, every primitive hyperbolic conjugacy class is uniquely represented by an aperiodic cyclic word (Lyndon block sequence) containing at least one R = [[1,1],[0,1]] and one L = [[1,0],[1,1]]. Reversing orientation maps Ra1Lb1⋯RakLbk to RbkLak⋯Rb1La1 via conjugation by S = [[0,−1],[1,0]], identifying reciprocal geodesics exactly (Artin 1924; Series 1985).

Proven

Prime Number Theorem (ordinary integers)

For ordinary primes, π(x) = #{ p ≤ x : p prime } ~ x / ln x and more sharply π(x) ~ li(x) (Hadamard 1896; de la Vallée Poussin 1896). Setting x = eL puts the two theorems on identical footing: Euler's product ζ(s) = ∏p (1 − p−s)−1 mirrors Selberg's product ZΓ(s).

Conjecture

Optimal square-root error term

It is conjectured that |πg(L) − li(eL)| = Oε(e(1/2 + ε)L), paralleling the Riemann Hypothesis bound |π(x) − li(x)| = Oε(x1/2 + ε). Subtlety: the nontrivial zeros of ZΓ(s) for PSL(2, Z) are already proven to lie on Re(s) = 1/2 (since λ1 ≈ 91.14 > 1/4), yet the eL/2 error bound remains open because the spectral density grows quadratically rather than linearly. The best proven exponent for PSL(2, Z) is 25/36 + ε (Soundararajan & Young 2013, improving Iwaniec 1984's 35/48 and Luo–Sarnak 1995's 7/10).

Observed up to L = 14

Exact numerical comparison verified up to L = 14 (t ≤ 1,096)

Computed live in the browser worker via Gauss reduction cycles for h+(D), Chebyshev trace inversion for P(t), and an exact sieve for π(⌊eL⌋). Independent brute-force cross-checks against {R, L}-necklaces (t ≤ 60) and raw SL(2, Z) matrix scans (t ≤ 12) confirm these values.

L Max t x = ⌊e^L⌋ π_g(L) π(x) e^L / L li(e^L)

References

  1. H. Huber, Zur analytischen Theorie hyperbolischer Raumformen und Bewegungsgruppen, Mathematische Annalen 138 (1959), 1–26.
  2. A. Selberg, Harmonic analysis and discontinuous groups in weakly symmetric Riemannian spaces with applications to Dirichlet series, J. Indian Math. Soc. 20 (1956), 47–87.
  3. P. Sarnak, Class numbers of indefinite binary quadratic forms, Journal of Number Theory 15 (1982), 229–247.
  4. C. Series, The modular surface and continued fractions, Journal of the London Mathematical Society 31 (1985), 69–80.
  5. K. Soundararajan & M. P. Young, The prime geodesic theorem, J. Reine Angew. Math. 676 (2013), 105–120.
  6. J. Hadamard (1896) & C.-J. de la Vallée Poussin (1896), independent proofs of the Prime Number Theorem.