Generating export...

Infinite Moduli, Roots of Unity, and the Density of Coprime Channels

An Interactive Exploration of Classical Results in Analytic Number Theory
by Wessen Getachew (@7dview)
Abstract: This interactive document explores the classical connection between rational points on the unit circle arising from roots of unity, the density of coprime integer pairs, and the asymptotic behavior of Farey sequences. We demonstrate that while the set of all rational angles is dense on the unit circle, the subset corresponding to reduced fractions (coprime numerator and denominator) has natural density 6/π². The global average of φ(m)/m over all moduli converges to 6/π², reconciling the fact that prime moduli individually approach density 1 while having measure zero in the integers.

Extended Framework: We further explore the deep connection between primitive lattice vectors, GCD-visibility, and the norm structure of Gaussian integers. Primitive lattice vectors (a,b) with gcd(a,b) = 1 determine visible rays from the origin and correspond naturally to reduced residues modulo suitable moduli, providing a geometric framework that unifies number-theoretic and analytic perspectives.

Mathematical Background & Theory

Visibility and Lattice Geometry

For any lattice point (a,b) ∈ ℤ², we define the visibility indicator:

Visibility Indicator:
vis(a,b) = 1 if gcd(a,b) = 1, else 0

A lattice point (a,b) is visible from the origin if and only if gcd(a,b) = 1. These primitive lattice vectors determine rays from the origin that hit no other lattice point before reaching (a,b). The set of primitive directions forms a fundamental geometric object in number theory.

Key Insight: The angle θ = arctan(b/a) for a primitive vector (a,b) provides a one-to-one correspondence between primitive lattice directions and angles that can be expressed as rational multiples of π (modulo appropriate symmetries).

Gaussian Integers and Norm Structure

Every primitive lattice vector (a,b) corresponds to a Gaussian integer z = a + bi with the property that gcd(a,b) = 1. The norm of this Gaussian integer is:

Gaussian Integer Norm:
N(z) = |a + bi|² = a² + b²

This norm connects lattice geometry to the theory of sums of two squares. A positive integer n can be expressed as a sum of two coprime squares (with specific multiplicity) if and only if in the prime factorization of n, every prime p ≡ 3 (mod 4) appears to an even power.

Fermat's Two-Square Theorem: A prime p can be expressed as p = a² + b² if and only if p = 2 or p ≡ 1 (mod 4). Moreover, this representation is unique up to signs and order when gcd(a,b) = 1.

The Riemann Zeta Function Connection

The constant 6/π² appears throughout number theory and is intimately connected to the Riemann zeta function ζ(s). Euler famously proved in 1734 that:

Euler's Basel Problem Solution:
ζ(2) = 1 + 1/4 + 1/9 + 1/16 + ... = Σn=1 1/n² = π²/6

Therefore, our density constant is simply 6/π² = 1/ζ(2). This connection reveals that the probability two random integers are coprime is the reciprocal of ζ(2).

Historical Development

Leonhard Euler (1707-1783) first proved the Basel problem and established the product formula for the zeta function:

Euler Product Formula:
ζ(s) = Πp prime (1 - p-s)-1 for Re(s) > 1

This product over primes directly implies the coprime density result. The probability that a prime p divides both random integers a and b is 1/p². Thus the probability that p divides neither (or only one) is 1 - 1/p². Taking the product over all primes:

P(gcd(a,b) = 1) = Πp (1 - 1/p²) = 1/ζ(2) = 6/π²

Modular Embedding and Circle Geometry

Each reduced residue r with gcd(r,m) = 1 maps naturally to the unit circle via the modular embedding:

Modular Embedding:
r ↦ e2πir/m = cos(2πr/m) + i·sin(2πr/m)

This embedding preserves the multiplicative structure of (ℤ/mℤ)* and provides a geometric representation of the reduced residue system. The φ(m) points form a regular φ(m)-gon inscribed in the unit circle, though not necessarily with consecutive vertices.

Proof Sketch: Average of φ(m)/m

We want to show that (1/N) Σm=1N φ(m)/m → 6/π² as N → ∞.

Key insight: For each pair (a, b) with 1 ≤ a < b ≤ N, the pair contributes to φ(m) exactly when m is a common divisor of a and b, and gcd(a/m, b/m) = 1.

By Möbius inversion and manipulating the double sum:

Σm=1N φ(m)/m = Σm=1N (1/m) Σd|m μ(d)·(m/d)
= Σd=1N μ(d) Σk=1⌊N/d⌋ 1
≈ N · Σd=1 μ(d)/d² = N · 1/ζ(2) = N · 6/π²

Therefore the average converges to 6/π².

Connection to Farey Sequences

The Farey sequence Fn is the sequence of completely reduced fractions between 0 and 1 with denominators ≤ n, arranged in increasing order. For example:

F5 = {0/1, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1/1}

The length of Fn is |Fn| = 1 + Σm=1n φ(m), which grows as (3/π²)n² + O(n log n). This is equivalent to our density theorem since we're counting coprime pairs (numerator, denominator).

Geometric Interpretation: Each element p/q ∈ Fn with gcd(p,q) = 1 corresponds to a primitive lattice direction (p,q) visible from the origin. The Farey sequence thus provides a canonical ordering of these visible directions within a bounded region.

Why Primes Don't Dominate

Although φ(p)/p = (p-1)/p → 1 for prime p, primes have density zero among integers by the Prime Number Theorem:

Prime Number Theorem (Hadamard & de la Vallée Poussin, 1896):
π(x) ~ x/ln(x), where π(x) counts primes ≤ x

As x → ∞, the ratio π(x)/x → 0, so primes become increasingly sparse. Meanwhile, highly composite numbers (with many small prime factors) have small φ(m)/m ratios and dominate the average. For instance:

The global average balances these competing effects, converging to 6/π² ≈ 0.6079.

Lattice Point Counting and Primitive Vectors

The number of primitive lattice vectors (a,b) with a² + b² ≤ R² grows asymptotically as:

Primitive Vector Asymptotics:
#{(a,b) : gcd(a,b)=1, a²+b²≤R²} ~ (6/π²)·πR² = (6/π)R² as R → ∞

This provides a geometric interpretation of the coprime density: in a large circle of radius R, approximately 6/π of the area contains primitive lattice points.

Related Results

Dirichlet's theorem on primes in arithmetic progressions (1837) and the study of L-functions extend these density results to restricted sets of integers, providing a rich framework for understanding coprimality in various contexts.

Lattice-Based Cryptography: The hardness of finding short primitive vectors in high-dimensional lattices forms the basis of post-quantum cryptographic systems, connecting these classical results to modern applications.

Multi-Canvas Export System

Select any combination of visualizations to export together. The system will automatically arrange them in an optimal grid layout with a comprehensive legend.

6 canvases selected

1. Unit Circle and Rational Angles

For each modulus m, the reduced residue system Φ(m) = {r : gcd(r, m) = 1, 0 ≤ r < m} maps to points on the unit circle via r → exp(2πi r/m). The visualization below shows these points for varying moduli.

Unit Circle Controls
20
4

Animation Controls

5

Canvas Zoom Controls

100%

Single Modulus View

Nested Modular Rings (1 to n)

Nested Rings Controls
12
1.0
2

Animation Controls

5
Global Coloring System
0.30
Global Labeling System

Selective Labeling Options

GCD-Specific Label Information

Label Appearance

1.0x
0.95

Nested Rings: Label Only Modulus

Canvas Zoom Controls

100%

Unit Circle Statistics

Total Points Plotted: 0
Coprime Points: 0
Coprime Ratio: 0
Canvas Zoom Level: 100%

2. Primitive Lattice Vectors & Gaussian Integer Geometry

A lattice point (a, b) ∈ ℤ² is primitive (or visible from the origin) if gcd(a, b) = 1. These points correspond to Gaussian integers z = a + bi with norm N(z) = a² + b². The norm is prime when it equals 2 or a prime p ≡ 1 (mod 4), by Fermat's Two-Square Theorem.

Lattice Visualization Controls
20
4

Animation Controls

5

Canvas Zoom Controls

100%

Primitive Lattice Vector Statistics

Lattice Range: ±20
Total Lattice Points: 0
Primitive Points (gcd=1): 0
Primitive Ratio: 0
Points with Prime Norm: 0
Average Norm (Primitive): 0
Canvas Zoom Level: 100%

3. Density of Coprime Pairs

Let AN = #{(a, b) : 1 ≤ a, bN, gcd(a, b) = 1} be the count of coprime pairs in an N × N grid.

Theorem (Coprime Pair Density):
limN→∞ AN / N² = 6/π² ≈ 0.6079
Coprime Pairs Controls
60

Animation Controls

5

Canvas Zoom Controls

100%

Coprime Pairs Statistics

Grid Size (N): 0
Total Pairs (N²): 0
Coprime Pairs (AN): 0
Ratio AN/N²: 0
Theoretical Limit (6/π²): 0.607927
Error from Limit: 0
Canvas Zoom Level: 100%

3. Average φ(m)/m Over All Moduli

For each modulus m, the ratio φ(m)/m represents the fraction of residues coprime to m. The average of these ratios converges to the same constant 6/π².

Theorem (Average Totient Ratio):
limN→∞ (1/N) Σm=1N φ(m)/m = 6/π² ≈ 0.6079
φ(m)/m Ratio Controls
100

Animation Controls

5

Canvas Zoom Controls

100%

Totient Ratio Statistics

Maximum Modulus: 0
Average φ(m)/m: 0
Theoretical Limit (6/π²): 0.607927
Error from Limit: 0
Prime Average (if checked): N/A
Canvas Zoom Level: 100%

4. Convergence Visualization

This chart shows how the running average of φ(m)/m converges to 6/π² as we increase the maximum modulus. The horizontal line represents the theoretical limit.

Canvas Zoom Controls

100%

5. Interpretation and Key Results

Summary of Findings:

Why There Is No Contradiction:

Prime moduli have φ(p)/p → 1, suggesting "almost all" residues are coprime. However, this does not contradict the global average of 6/π² because:

This phenomenon is analogous to how the average value can differ substantially from the behavior of a sparse subsequence.