1/2
110 Hz
A2
Audio Engine LIVE
220
100%
110 Hz
1/2 = A2
Musical Intervals
Harmonic Mode
Consonant q ≤ 4
Unison q=1
Consonant q≤4
Complex q≤16
Dissonant q>16
Arnold Tongue
0.50
Harmonic Series
8
Options
Selected Fraction
Click any point to select

Farey Sector Formula - Complete Research Platform

Comprehensive analysis with RH connections, modular arithmetic, and advanced visualizations

C(n, N) = 3N² / (π² n(n+1))

Asymptotic count of coprime pairs (r, m) with r/m in sector S_n = (1/(n+1), 1/n]

Exact
Hybrid
Formula
Exact enumeration
to
to
Main
Theory
Theory Viz
Gaps
Franel-Landau
Dedekind
Continued Fractions
PSL(2,Z)
Euler Product
Modular
3D View
Hyperbolic
Animation
Smith Chart
Statistics
Primes
Harmonic
Primorial Sieve
Research

Main Sector Analysis

C(n,N) = 3N² / (π² n(n+1))

Definition: Sectors are defined by consecutive Farey bounds: sector S_n spans the interval (1/(n+1), 1/n], a decreasing sequence of intervals that partition [0,1]. Formula Purpose: This asymptotic formula provides increasingly accurate predictions of the count of coprime pairs (r,m) with r/m in sector S_n, where N is the maximum denominator. As N grows, the accuracy of this prediction improves significantly. The formula shows how the Farey sequence distributes its fractions across the unit interval with mathematical precision.

Exact vs Predicted

Relative Error %

Sector Data (click row to see primes)

nIntervalExactPredErr%PrimesComposites

Sector Ring (click points to see tree path)

Sector Tree Path (Stern-Brocot navigation - click nodes to play)

Click a point on the ring or tree to see its path and play its frequency
Tree nodes
Path to target
Target fraction
L (left)
R (right)
Arnold:
Unison
Consonant
Complex

Directional Density of Coprime Lattice Points in Farey Sectors

Wessen Getachew

Abstract

We study the distribution of coprime integer pairs (a,b) with bounded height whose rational slope lies in a fixed Farey sector S_n = (1/(n+1), 1/n]. Using classical summatory totient estimates together with a geometric decomposition of rational directions, we derive an explicit asymptotic formula for the number of primitive lattice points in each sector. This result provides a localized refinement of the global coprime density 1/zeta(2), revealing directional structure in the distribution of visible lattice points.

1. Introduction and Motivation

The probability that two randomly chosen integers are coprime is 1/zeta(2) = 6/pi^2 approximately 0.6079, a classical result with interpretations in analytic number theory and geometry of numbers. Geometrically, this corresponds to the density of visible lattice points in Z^2.

Farey sequences organize rational numbers in [0,1] by increasing denominator and naturally partition rational directions into intervals. While global coprime density is well understood, we focus on directional coprime density - how primitive lattice points distribute across specific rational slope bands.

2. Definitions

Farey Sector
S_n = (1/(n+1), 1/n]

Intervals partitioning (0,1], bounded by consecutive Farey fractions.

Primitive Lattice Point
(a,b) in Z^2 where gcd(a,b) = 1, b >= 1

Pairs with coprime coordinates representing visible lattice points.

3. Main Result

Farey Sector Density Theorem

Let n be fixed. As N approaches infinity, the number of coprime integer pairs with slope in the Farey sector S_n satisfies:

C(n,N) ~ (3/pi^2) * N^2 / (n(n+1))

Where C(n,N) counts pairs (a,b) with 1 <= b <= N, gcd(a,b)=1, and a/b in S_n.

4. Proof Sketch

Step 1: The condition a/b in S_n = (1/(n+1), 1/n] is equivalent to b/(n+1) < a <= b/n.

Step 2: For each b, the number of integers a in this range is b/(n(n+1)) + O(1).

Step 3: Restricting to coprime pairs: Sum over b<=N of phi(b)/(n(n+1)) + O(N)

Step 4: Apply the classical summatory totient estimate:

Sum of phi(b) = (3/pi^2)N^2 + O(N log N)

Conclusion: C(n,N) = (1/(n(n+1))) * ((3/pi^2)N^2 + O(N log N))

5. Computational Verification

Sector nWidth 1/(n(n+1))Asymptotic FactorGlobal Fraction
11/23/(2pi^2)approximately 0.1519
21/63/(6pi^2)approximately 0.0506
31/123/(12pi^2)approximately 0.0253
n1/(n(n+1))3/(pi^2 n(n+1))1/n(n+1) * 6/pi^2

Numerical experiments confirm convergence to predicted asymptotics at rates consistent with O(N log N) error decay. Interactive visualizations above display accumulation of primitive lattice points within each Farey sector.

6. Key Theoretical Connections

Euler and Coprime Density

Global density 1/zeta(2) = 6/pi^2 emerges as sum of sectoral contributions.

Franel-Landau Connection

Farey gap distribution relates to RH via: Sum|F_k - k/|F_N|| = O(N^(1/2+epsilon)) iff RH

7. Conclusion

Farey sectors provide a natural geometric decomposition of rational directions. By combining this structure with classical coprime density results, we obtain an explicit directional refinement of visible lattice point counts. This framework enables anisotropic analysis of arithmetic distributions and provides foundation for modular constraints, higher-dimensional generalizations, and computational number theory.

Acknowledgments: Foundational work of Euler, Mertens, and others on totient summation and Farey geometry.

Interactive Theory Visualization

Visual exploration of the Farey Sector Density Theorem with interactive elements

Sector Partition of (0,1]

Density Cone: C(n,N) ~ N²/n(n+1)

Summatory Totient: Σφ(b) ~ 3N²/π²

Actual Σφ(b)
Asymptotic 3N²/π²

Visible Lattice Points by Direction

Visible (gcd=1)
Hidden (gcd>1)
Sector Boundary

Proof Visualization: Step-by-Step Accumulation

Cumulative count
Predicted asymptotic
φ(b)/(n(n+1)) contribution

Convergence Rate Analysis

Sector Density Heatmap: C(n,N) across parameters

Low density
Medium
High density
Theorem Summary: For fixed sector n, as N approaches infinity: C(n,N) = (3/π²) × N² / (n(n+1)) + O(N log N). This follows from summing φ(b)/(n(n+1)) over denominators b ≤ N and applying the classical totient summation formula.

Farey Gap Analysis

gap(a/b, c/d) = |c/d - a/b| = 1/(b*d)

For consecutive Farey fractions a/b and c/d, the gap between them equals exactly 1/(b*d). This elegant formula shows that gaps decrease as denominators grow. The distribution reveals how fractions cluster and spread across the unit interval.

Gap Distribution (Color = Size)

Gap vs Denominator Product

Largest Gaps (sorted by gap size)

#Left FractionRight FractionActual GapTheoretical 1/(bd)Match
Key Insight: Every gap exactly equals 1/(bd) where b and d are the denominators of consecutive Farey fractions. This is a consequence of the mediant property: for neighbors a/b and c/d, we have |ad - bc| = 1.

Franel-Landau Theorem

Σ|δ_k| = O(N^(1/2+ε)) ⟺ Riemann Hypothesis

Define δ_k = F_k - k/|F_N| as the k-th Farey fraction deviation. The growth rate of Σ|δ_k| is directly equivalent to the Riemann Hypothesis. If RH is true, the sum grows slower than N^(1/2+ε) for any ε > 0. This provides a concrete computational test for RH properties through Farey sequence analysis. Note: These computations illustrate known equivalences but do not constitute a proof or disproof of RH.

Deviation δ_k vs k

Cumulative |δ| / N^α

Σ|δ| / N^α for various α

Interpretation: If RH is true, the normalized sum should stay bounded. Divergence for alpha <= 1/2 would contradict RH.

Dedekind Sums

s(h,k) = Σ_{j=1}^{k-1} ((j/k))((hj/k))

Dedekind sums are arithmetic functions encoding properties of coprime pairs (h,k). They satisfy reciprocity formulas: s(h,k) + s(k,h) = -1/4 + (1/12)(h/k + k/h + 1/(hk)). These sums connect to modular forms and are fundamental in algebraic number theory.

Dedekind Sums

Definition: s(h,k) = Σ_{j=1}^{k-1} ((j/k))((hj/k)) where ((x)) = x - ⌊x⌋ - 1/2 if x∉ℤ, else 0

s(h,k) Heatmap

s(1,k) vs k

Dedekind Sum Table

hks(h,k)12k·s(h,k)gcd
Reciprocity: s(h,k) + s(k,h) = -1/4 + (1/12)(h/k + k/h + 1/(hk))

Continued Fractions

Stern-Brocot Encoding: Path L^a R^b L^c... encodes CF [0; a, b, c, ...]

Selected Fraction

Click a row in the table below to select a fraction

Continued Fraction Expansions (click row to select & play)

r/mCF [a0; a1, a2, ...]PathLengthSum(a_i)FreqPlay

CF Length Distribution

First Partial Quotient

PSL(2,ℤ) Matrices

Farey Neighbor Property: For consecutive Farey fractions a/b, c/d: |ad - bc| = 1, giving matrix [a,c; b,d] ∈ SL(2,ℤ)

Neighbor Matrices

Ford Circles

Determinant Verification

Euler Product for ζ(2)

Euler: ζ(2) = Σ 1/n² = ∏_p 1/(1-1/p²) = π²/6, hence 6/π² = ∏_p (1-1/p²)

Product Terms

Partial Product → 6/π²

Partial Sum → π²/6

Connection: The coprime probability 6/pi^2 emerges from excluding multiples of each prime p with probability 1/p^2.

Modular Arithmetic Analysis

Residue Class Distribution

Prime Channel Ownership

Lifting Tower: m → 2m, 3m, ...

3D Sector Cone

Third axis represents denominator m. Points at height m have coprime numerators r with r/m in the sector range. The cone structure shows density increasing with m^2.

Hyperbolic Plane / Poincaré Disk

Farey Tessellation: The hyperbolic plane is tessellated by ideal triangles with vertices at Farey fractions on ∂H.

Farey Sequence Growth

Ready

Smith Chart Transform (Cayley Map)

Cayley Transform
Γ = (z - 1)/(z + 1)
Input z
z = R·e^(iθ), θ = 2πr/M + α
Properties
Conformal • Angle-preserving
90°

Smith Chart (Cayley Transform)

Transformed points
Prime moduli
Constant-R
Constant-X

Original z-plane (Pre-transform)

z = R·e^(iθ)
Unit circle

Transform Mathematics

Cayley Transform
Γ = (z - 1)/(z + 1)
z = R·e^(iθ)
Real Part
Re(Γ) = (AC + B²)/(C² + B²)
A = Rcosθ - 1, B = Rsinθ
C = Rcosθ + 1
Imaginary Part
Im(Γ) = B(C - A)/(C² + B²)
Special (R=1):
Γ(θ) = i·tan(θ/2)

Transform Data

r/mθ (rad)Rz = Re^iθΓ = (z-1)/(z+1)|Γ|

Statistical Analysis

Random vs Actual Distribution

Cross-Sector Correlation

Error Term O(N log N)

Local Density Analysis

Correlation Matrix

Prime Analysis

Twin Prime Gap Markers

Prime vs Composite Moduli

Prime k-tuple Correlations

Prime Denominator Density

Twin Prime Gaps in Farey Sequence

Harmonic Analysis & Arnold Tongues

Map Farey fractions to musical frequencies, explore consonance/dissonance, and visualize Arnold tongues

Frequency Ratio
f = f₀ × (p/q)
Consonance Principle
Small q = Pure intervals
Arnold Tongue Width
∝ K/q (coupling/denom)
Hz

Arnold Tongues (Stern-Brocot)

0.60
Unison (q=1)
Consonant (q≤4)
Complex (q≤16)
Dissonant (q>16)

Frequency Spectrum

Frequency bars
Octave lines

Consonance Map

High consonance
Low consonance

Interval Circle (Pitch Class)

Fraction position
12-TET reference

Musical Intervals in Sector

FractionRatioFrequencyCentsClosest NoteInterval NameModePlay
Harmonic Theory: Fractions p/q with small denominators q produce consonant intervals. The ancient Greeks discovered that simple ratios like 2:1 (octave), 3:2 (fifth), and 4:3 (fourth) sound harmonious. Arnold tongues show how these ratios create stable "locking" regions in coupled oscillator systems - wider tongues indicate more robust synchronization.

Primorial Sieve & Farey Sector Connection

Exploring how primorial residue classes connect to Farey sector distribution

Primorial Density
φ(P_k)/P_k = ∏(1-1/p)
Unified Formula
C(n,N,a,k) = 3N²/(π²n(n+1)φ(k))
30×2ⁿ Density
φ(30×2ⁿ)/(30×2ⁿ) = 4/15

Sector × Residue Heatmap

Low
Medium
High

Density Constant Verification: φ(k×2ⁿ)/(k×2ⁿ)

Actual φ(m)/m
Constant = φ(P_k)/P_k

Lifting Tree: Residue Class Splitting

Residue class
In sector
Split children

Unified Formula Verification

Actual C(n,N,a,k)
Predicted 3N²/(π²n(n+1)φ(k))

Prime Distribution Across Residue Classes

Prime count
Expected (uniform)

Sector Uniformity Test

Actual per class
Expected C(n,N)/φ(k)

Primorial Comparison: φ(P_k)/P_k → 6/π² Convergence

φ(P_k)/P_k
∏(1-1/p²) partial
6/π²

Coprime Residue Classes for Current Modulus

Sector × Residue Data Table

SectorTotalPer Class Avgχ² StatUniform?
Key Insight: The unified formula C(n,N,a,k) = 3N²/(π²n(n+1)φ(k)) combines Farey sector distribution with primorial residue filtering. This shows that coprimes distribute uniformly across residue classes within each sector, and the density φ(30×2ⁿ)/(30×2ⁿ) = 4/15 remains constant under power-of-2 scaling.

Research Tools

Custom Formula Tester

Custom vs Standard

Batch Parameter Sweep

N|F_N|Σ|δ|Σ|δ|/√NMax GapMean Gap

Publication Export

Screenshot Preview (with Legend)