WESSEN GETACHEW P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 ½+it P15 Opener

Farey Modular Residue Rings

An Interactive Visualization of Modular Arithmetic, Prime Structure, and the Farey Sequence

The Unit Circle & Its Many Faces

A unit circle is the set of points satisfying x² + y² = 1 — but the same parameters (radius = 1, circumference = 2π, rotation θ ∈ [0, 2π)) manifest in many different geometric shapes and coordinate systems. The same mathematical object, viewed through different coordinate systems. The Farey modular residue rings visualized here are precisely one such lens: the classical circle becomes a discrete, modular shell system — and the structures below illuminate why this connection is so deep.

§ 1
Square / Wave Strip (Fourier View)
Unwrapping the angle parameter θ maps the circle into a rectangular strip. Plotting cos θ and sin θ against θ transforms the closed curve into two interleaved waves inside a bounded rectangle — exactly how Fourier analysis encodes periodicity. x = cos θ,  y = sin θ,  θ ∈ [0, 2π) Circle → sine/cosine waves in a strip.
§ 2
Complex Exponential
In the complex plane every number of magnitude 1 lies on the unit circle, forming the multiplicative group |z| = 1. The circle collapses into a single formula that turns geometry into rotation algebra. z = e Circle → complex exponential rotation.
§ 3
Polygon Approximation
A circle is the limiting case of regular n-gons as n → ∞. Triangle, square, hexagon, 1000-gon — all with vertices on radius 1. This is a direct bridge to the discrete shells in the Farey residue visualizer. limn → ∞ regular n-gon = circle
§ 4
Diamond (L¹ / Manhattan Metric)
Changing the distance rule changes the shape of the unit "circle." Under the Manhattan (L¹) metric the locus of points at distance 1 from the origin is a square rotated 45° — a diamond. |x| + |y| = 1
§ 5
Square (L∞ / Chebyshev Metric)
Under the Chebyshev (L∞) metric — where distance is the maximum of the coordinate differences — the unit circle becomes an axis-aligned square. The metric, not the circle, is what changed. max(|x|, |y|) = 1
§ 6
Cylinder / Rectangle (Unwrapped)
Cutting the circle at θ = 0 and unrolling it produces a line segment of length 2π. Adding a height dimension yields a cylinder. This is precisely the π × 2π rectangle picture — a circle with wrapped edges. Circle ↔ rectangle with identified edges
§ 7
Modular Number Line (ℝ/ℤ)
The real numbers modulo 1 wrap the number line into a circle: 0 and 1 become the same point, and every real number maps to an angle θ = 2πx. This is the algebraic foundation of the modular residue geometry shown here. ℝ/ℤ → unit circle,  θ = 2πx
§ 8
Real Line via Stereographic Projection
Stereographic projection from the north pole maps every point on the circle to a unique real number — except the pole itself, which corresponds to a "point at infinity." Used extensively in complex analysis. Circle ↔ ℝ ∪ {∞}
§ 9
Lattice Shell View
Scaling the unit circle by integer radii produces concentric shells of integer lattice solutions to x² + y² = r². Counting such representations connects to the Gauss circle problem and Dirichlet's divisor theory — and the modular shell work here is a discrete, modular version of exactly this. x² + y² = r²,  r ∈ ℤ
§ 10
Fourier Frequency Circle
In digital signal processing the unit circle in the z-plane represents all possible frequencies. Stability, filtering, and spectral analysis all read off the circle — connecting time-domain signals to circular frequency space. z = e,  ω ∈ [0, 2π)
Geometry / System Shape of "Unit Circle" Key Equation
EuclideanCirclex² + y² = 1
Manhattan (L¹)Diamond|x| + |y| = 1
Chebyshev (L∞)Squaremax(|x|,|y|) = 1
Polygon limitRegular n-gon → circlen → ∞
Complex / FourierExponential rotationz = e
Topology (mod 1)Wrapped number lineℝ/ℤ
Lattice shellsInteger ringsx² + y² = r²
Modular residuesDiscrete Farey ringsr/m ∈ Farey(N)
⭐ The Deeper Idea
A circle is fundamentally just a periodic parameter. Any mathematical structure with the periodicity θ ~ θ + 2π can be interpreted as — or placed in correspondence with — a unit circle. The Farey modular residue rings explored in this tool are a discrete, arithmetic instantiation of that same periodicity: the angle becomes a reduced fraction r/m, the ring becomes a modular shell, and the Farey sequence organises the shells in exactly the way that uniform angle spacing organises the classical circle. θ ~ θ + 2π  ↔  r/m ~ r/m + 1
◆ Unit Circle Presets
: MOD N | GAP
|
C(n) — live value & survival ratiostap to expand | depth n 12%
■ View & Color
LABEL MODE
LABEL SCOPE
LABEL STYLE
LABEL SIZE
7
RESIDUE TRACK
r = | THICK 1.0 | COLOR
quick r:
POINT COLOR MODE
gcd=1
gcd>1
CANVAS SIZE
Y
px
X
px
■ Ring Geometry
RING SPACING
RING SCALE
INNER RADIUS
Z
POINT SIZE
■ Connections
SHOW CHORDS
THICKNESS
ANGLE DIRECTION
■ Per-Ring Rotation
PER-RING CUMULATIVE ROTATION
STEP a/b
/ × 360°
DIRECTION
AUTO-ROTATE SPEED
100
DYNAMICS
CONTROLS
RING POLYGON
POINTS TO CONNECT
WHICH RINGS
SAME-MOD LINE COLOR
SAME-MOD THICKNESS
0.75
CROSS-MOD THICKNESS
3.0
LIFT LINE THICKNESS
20px
gcd(r, m) = 1
gcd(r, m) > 1
Decimal Places 6 |
■ Ring Radii & Areas
■ GCD(R, M) = 1  ·  Coprime
■ GCD(R, M) > 1  ·  Non-Coprime
■ What This Shows

Each rational r/m with 0 ≤ r ≤ m, 1 ≤ m ≤ N is placed at angle 2πr/m on ring m. Blue points satisfy gcd(r,m)=1 — these are the Farey fractions. By the Franel–Landau theorem, RH is equivalent to the summed Farey deviations satisfying Σ|δν| = O(N½+ε), where δν = fν − ν/|FN|; if that sum grows faster, ζ(s) has a zero off the critical line. The observed near-uniformity at finite N is consistent with RH; it is not a proof of it. Red points (gcd(r,m)>1) are the composite residues; they sit at angles 2πr/m where r and m share a common factor, concentrating at rational multiples of 2π that correspond to the divisor structure of m.

The cross-mod connections follow residue r across rings N→1, tracing the channel each residue class cuts through the modular hierarchy. The ring polygon connects consecutive residues on a single ring: mod 4 with all points gives a square; gcd=1 only at mod 4 leaves r=1 and r=3, a diameter. At mod 8 with gcd=1, the units 1,3,5,7 form a square — the polygon degree drops from 8 to 4 because only the reduced residues remain.

The gap overlay marks the pairs (p mod N, (p+g) mod N) for primes with forward gap exactly g. Outer-ring chords show which residue classes carry twin, cousin, or sexy prime pairs. The inward spiral traces the full cross-mod ancestry of each endpoint back through rings N→1.

◡ Sacks Number Spiral — Archimedean spiral · integers at angle 2π√n, radius √n
■ Spectral Correlation — Farey gaps vs GUE · nuclear levels · Riemann zeros
■ N-Body Orbits
| | K= Spd 10 | Preset: |
t=0.000 E= sep= |

Rational Unit Circle

Roots of unity, coprimality, and Farey structure

§1 — Roots of Unity

Each rational r/m is placed on ring m at angle θ = 2πr/m, corresponding to the m-th roots of unity

These points form a regular m-gon on the unit circle. The full structure across all rings 1 ≤ m ≤ N is a modular lattice on concentric circles.

§2 — The Unit Group

The multiplicative units modulo m are the residues coprime to m:

Their count is Euler’s totient φ(m). These are the Farey fractions — the blue points in the visualiser. They define the primitive angular directions not eliminated by the divisibility structure of m.

§3 — Modular Hierarchy

Each modulus generates a regular polygon. The primorial sequence eliminates composite directions one prime at a time:

What remains after each step are exactly the angular rays where primes can occur. Use the hierarchy navigator below to walk through each level interactively.

§4 — Prime Residue Rays

All primes greater than p must lie on the unit-group rays of the primorial modulus M = 2·3·…·p:

For M=30 this gives 8 rays; for M=210, 48 rays. The gap overlay marks which pairs carry twin primes (gap=2), cousin primes (gap=4), or sexy primes (gap=6).

§5 — Twin Prime Geometry

Twin prime candidates (p, p+2) correspond to residue pairs (r, r+2) both coprime to M. Their angular separation on ring m is:

As M grows through primorial extensions, admissible twin-prime ray pairs lift to the refined lattice. The candidate directions are preserved through sieve refinement — visible as parallel chord pairs in the gap overlay.

§6 — Farey Discrepancy & RH

By the Franel–Landau theorem, the Riemann Hypothesis is equivalent to the summed deviations of the Farey fractions from equal spacing satisfying:

The near-uniform angular distribution visible at finite N is consistent with RH. It is not a proof — only a geometric shadow of the analytic statement. The N-body panel and gap overlay make the discrepancy geometry directly visible.

§7 — Density & Sieve Thinning

The proportion of primitive residues mod m is given by the Euler product; along the primorial sequence M = 2·3·5·…·p it decays to zero (though not for general m — for prime m it approaches 1):

The lattice refines as m grows while allowed directions simultaneously thin — a precise quantification of prime sparsity. Averaged over all m ≤ N this density converges to 6/π² = 1/ζ(2). The hierarchy navigator tracks φ(N)/N live.

§8 — Laurent Annuli & Partial Fractions

The ring structure is the discrete skeleton of a Laurent series. For a rational function with poles at coprime prime residues r₁,r₂,… mod N, the complex plane splits into annular convergence regions — one per gap between consecutive pole radii.

The analogy drawn here: gcd(r,m)=1 points play the role of irreducible partial-fraction terms, while gcd(r,m)>1 points reduce to lower-denominator rings — just as non-lowest-terms fractions reduce. This is a structural analogy, not a theorem: no result identifies the 6/π² coprime density with a fraction of Laurent basis elements. What is rigorous is the classical annulus picture above (a rational function converges in the annuli between consecutive pole radii) and the coprime density itself.

The N-body panel uses these same rₖ as orbit positions — bodies in the annular band between poles. The explorer below shows the decomposition live as N changes.

■ Laurent Explorer — live with mod N slider
Poles — coprime primes mod N
Annuli (inner / annulus / outer)
Partial fraction decomposition

§9 — Riemann’s Explicit Formula

Riemann’s explicit formula gives the prime-power counting function Π₀(x) = Σpk≤x 1/k exactly, with one oscillatory correction per nontrivial zero ρ of ζ(s). (π(x) is then recovered by Möbius inversion: π(x) = Σn μ(n)/n · Π(x1/n).) The known zeros all have Re(ρ) = ½; that this holds for every zero is precisely RH. Writing ρ = ½ + iγn:

Each conjugate pair ρ, ρ¯ produces a real oscillation of amplitude ≈ 2√x/(|ρ| log x) and phase γn log x. The Farey discrepancy DN grows no faster than N½+ε exactly when every zero sits on the critical line — the Franel–Landau equivalence to RH (§6). The N-body panel places bodies at residue positions rk = pk mod N — a loose visual analogy to the xρ phase evaluations, not a formal correspondence. Similarly, the pairing of conjugate zeros (γn, −γn) visually parallels the (r, N−r) mirror involution on the coprime ring.

■ Explicit Formula Explorer
K zeros x =
First K zeros ρ = ½ + iγn
Formula terms at x
◆ Modular Hierarchy — click to navigate
φ(N)/N =
φ(N)/N
0
Rational Unit Circle · Modular Residue Structure
Choose your modulus N
Geometry of fractions r/m opens at your chosen N · 1 – 1024
QUICK PICK
Prime gap overlay (optional)
Open to
C(n) — open with depth (optional)
C(n) = ζ(2) · ∏p prime(1 − min(n+1, p) / p²)
Turns on the C(n) canvas link at this depth for the N above · leave blank to skip
10
auto
skip — use default (N=128, split view)