u/Background-Major4104

​

  1. The Ring Geometry

https://wessengetachew.github.io/MODZ/

For each modulus M ≥ 1, define the coprime residue set

R(M) = { r ∈ {1, …, M−1} : gcd(r, M) = 1 } |R(M)| = φ(M)

Each element r is placed on a unit circle at angle

θ(r, M) = 2π · r/M

In the concentric arrangement, ring M sits at radius proportional to M (scaled to fit the canvas). The result: nested circles, each carrying φ(M) dots. As M grows, the dot density per ring trends toward the average coprime density 6/π² ≈ 60.79%.

Global Rotation

A global rotation angle α is applied to every point:

θ_displayed(r, M) = 2πr/M + α + (M−1)·δ

where δ is the per-ring rotation increment (ring rot slider). Default: α = π/2 (90°, entered as 1/4 × 360°). Labels optionally stay fixed at their unrotated positions regardless of α.

  1. The Lift Condition

A residue r on ring M lifts to ring M+1 when

gcd(r, M+1) = 1

Every coprime residue satisfies gcd(r,M)=1 by definition. The lift condition adds the requirement for the next modulus. Lift lines: green when it lifts, red when blocked.

Chain-n Survival

Require r to lift through n consecutive rings:

gcd(r, M+j) = 1 for j = 1, 2, …, n

The chain slider restricts visible lift lines to residues satisfying all n conditions simultaneously. As n increases, fewer points qualify and the canvas thins.

  1. Live Counters

Three quantities update in the status bar on every render:

φ / total

Σ φ(M) / Σ (M−1)

→ 6/π² ≈ 0.6079

lift / φ = C(N)

Σ T(M) / Σ φ(M)

→ C ≈ 0.530712

M range

M_min – M_max

ring count, point count

where T(M) = |{r ∈ R(M) : gcd(r, M+1) = 1}| is the count of lifting residues on ring M.

The Lift Survival Constant C

C = lim_{N→∞} Σ_{M=2}^{N} T(M) / Σ_{M=2}^{N} φ(M) = ∏_p (p²−2)/(p²−1) = ζ(2) · ∏_p(1−2/p²) = ζ(2) · d_FT ≈ 0.530711806246…

where d_FT = ∏_p(1−2/p²) ≈ 0.3226 is the Feller–Tornier constant (OEIS A065469). The status bar shows the empirical C(N) for the current M range, converging toward 0.530712 as M_max grows.

Coprime Density

Σ_{M=2}^{N} φ(M) / Σ_{M=2}^{N} (M−1) → 6/π² ≈ 0.607927

This is the density of coprime pairs among all integer pairs — the fraction of the full grid occupied by points on the canvas.

  1. Color Modes

16 color modes control how every point is colored. Applied per-point at render time based on (r, M, θ).

  1. Display Overlays

Prime Spiral

For a fixed prime p, the residue r=p appears on every ring M where gcd(p,M)=1 — all M not divisible by p. Its angular position θ=2πp/M sweeps as M grows, tracing a spiral. Three geometric features emerge:

Equator gap

At M=2p: gcd(p,2p)=p≠1. The spiral always skips ring 2p. The gap is visible as a break in the colored path.

Upper path r=(M+1)/2 — always red

gcd((M+1)/2, M+1) = (M+1)/2 ≥ 2. This residue never lifts to M+1. Always shown blocked.Lower path r=(M−1)/2 — alternating

gcd((M−1)/2, M+1) = gcd((M−1)/2, 2) = 1 iff M≡3(mod 4). At a prime q this is the condition for q to be inert in ℤ[i] — the primes not expressible as a sum of two squares.

Lift Lines

Green segment from (M,r) to (M+1,r) when gcd(r,M+1)=1. Red when blocked. Opacity and line width are adjustable. The chain slider restricts to n-consecutive-lift survivors.

N-gon Polygons

Connect the φ(M) coprime points on ring M in angular order — you get the coprime polygon, a geometric representation of (ℤ/Mℤ)×. Three modes:

Mode Vertices Example M=6

Coprime only φ(M) vertices at coprime r Triangle: r=1,5 (+ closure)

Full M-gon All M points Hexagon: all r=0…5

Both Both overlaid Triangle inside hexagon

Gap Chords

For a chosen gap value k, connect residues r and r+k on the same ring when both are coprime. k=2 shows twin-prime pairs geometrically; k=6 shows sexy pairs.

Non-Coprime Points

Points where gcd(r,M)>1 — the zero divisors of ℤ/Mℤ. Colored by their gcd value (hue = gcd×47 mod 360). Hoverable when inspect is on.

  1. The Inspect System

With Inspect ON, clicking any point opens a panel showing:

Field Value / Formula

r / M Residue and modulus

r/M decimal Fractional position on circle

θ angle 2πr/M in degrees

Farey sector n ⌊M/r⌋ — sector containing r/M

Half r/M > ½ (top) or r/M ≤ ½ (bottom)

Lift to M+1 gcd(r, M+1) = 1 ✓ or ✗

gcd(r,M) Should be 1 for coprime points

gcd(r,M+1) 1 = lifts, >1 = blocked

φ(M) Number of coprime residues on this ring

M prime Whether the modulus is prime

Mirror M−r gcd(M−r, M+1) shown

Appearances How many rings r appears on in [M_min, M_max]

Connect-same-r: when a point is inspected, gold dashed arrows connect all rings where r appears as a coprime residue, with arrowheads at midpoints and M= labels.

u/Background-Major4104 — 12 days ago