HomeArticlesMathematics

Ford Circles & the Farey Sequence: A Circle for Every Fraction

Every reduced fraction p/q gets a circle of radius 1/(2q^2) tangent to the number line, and Farey neighbours are exactly the circles that touch.

mysimulator teamUpdated June 2026≈ 8 min read▶ Open the simulation

A circle for every fraction

Take any fraction p/q in lowest terms between 0 and 1. Draw a circle tangent to the number line at the point x = p/q, sitting above the line, with radius 1/(2q²). Do this for every reduced fraction and you get the Ford circles, introduced by Lester Ford Sr. in 1938. Fractions with small denominators — 0/1, 1/1, 1/2 — get large circles; fractions with large denominators get vanishingly small ones. The remarkable fact is what happens between any two of these circles: they either sit apart, or they are exactly tangent, and they are never overlapping.

live demo · Ford circles tangent to the number line at each p/q● LIVE
radius(p, q) = 1 / (2 * q * q)     // circle for reduced fraction p/q
centre(p, q) = (p/q, 1/(2*q*q))     // tangent to the x-axis at p/q

// two Ford circles for p1/q1 and p2/q2 are tangent  ⇔
|p1*q2 - p2*q1| = 1                 // i.e. the fractions are Farey neighbours

Tangent, never overlapping — and the proof is one inequality

Two Ford circles for reduced fractions p₁/q₁ and p₂/q₂ are externally tangent exactly when |p₁q₂ − p₂q₁| = 1, and otherwise they are always strictly disjoint — never overlapping, regardless of how close the two fractions are numerically. This follows from a short distance calculation: the distance between the two centres compares directly against the sum of the two radii, and the difference works out to be a perfect square of (p₁q₂ − p₂q₁), which is zero exactly at tangency and strictly positive otherwise. It's a clean example of an analytic fact (circles touching) being controlled entirely by a number-theoretic condition (a determinant of numerators and denominators equal to 1).

The Farey sequence and mediants

The Farey sequence F(n) lists every reduced fraction between 0 and 1 with denominator at most n, in increasing order. F(1) = {0/1, 1/1}, F(2) adds 1/2, F(3) adds 1/3 and 2/3, and so on. Two consecutive fractions p₁/q₁ < p₂/q₂ in any Farey sequence always satisfy p₂q₁ − p₁q₂ = 1 — exactly the tangency condition for Ford circles — so consecutive Farey fractions correspond to tangent Ford circles, and the whole picture of circles sitting in a row along the number line is a direct visualisation of Farey neighbours.

The sequence builds itself by mediants: between any two Farey neighbours a/b and c/d, the fraction (a+c)/(b+d) — the mediant, not the average — is the unique fraction with the smallest possible denominator that fits strictly between them, and inserting it at every step is exactly how F(n) grows into F(n+1) wherever the new denominator stays ≤ n+1. Geometrically, the mediant's Ford circle is the largest circle that fits in the curved triangular gap between the two neighbouring circles and the number line, tangent to all three.

The Stern-Brocot tree hiding underneath

Repeatedly inserting mediants without any denominator limit generates every positive rational number exactly once, organised into the Stern-Brocot tree — starting from 0/1 and 1/0 (representing 0 and infinity) and mediant-inserting forever produces a binary tree where each rational appears in lowest terms automatically, with no reduction step ever needed. The Farey sequence F(n) is simply this same tree read off level by level, truncated to denominators ≤ n. This connects Ford circles to continued fractions too: the path from the root to any rational p/q in the Stern-Brocot tree, read as a sequence of left/right moves, directly encodes p/q's continued-fraction expansion.

Why this matters beyond a pretty picture

Ford circles and Farey sequences are the geometric backbone of Diophantine approximation — the study of how well irrational numbers can be approximated by fractions. The gaps between Ford circles bound how close a fraction with a given denominator can possibly get to a target real number, which is exactly the content of theorems like Hurwitz's theorem on rational approximation. The same machinery underlies the Stern-Brocot / Euclidean algorithm connection used in some computational number theory and, more whimsically, in the design of musical tuning systems and gear-ratio approximation, where you want the "simplest" fraction close to an irrational ratio.

Frequently asked questions

Why do Ford circles never overlap, even for very close fractions?

The distance between two Ford circles' centres minus the sum of their radii works out algebraically to a perfect square proportional to (p1*q2 - p2*q1)^2, which is always >= 0. It equals zero only when the fractions are Farey neighbours (the determinant equals 1), meaning the circles are tangent; otherwise the circles are strictly separated, no matter how numerically close the two fractions are.

What is a mediant and why isn't it the average?

The mediant of a/b and c/d is (a+c)/(b+d), formed by adding numerators and denominators separately rather than averaging the fraction values. It's the unique fraction with the smallest denominator lying strictly between the two, which is why it's the natural next fraction to insert when building the Farey sequence or the Stern-Brocot tree.

How are Ford circles related to continued fractions?

Every rational number appears exactly once in the Stern-Brocot tree, generated by repeated mediant insertion, and the left/right path from the root to that rational encodes its continued-fraction expansion. Since Farey sequences are levels of that same tree, the tangency pattern of Ford circles is a geometric picture of continued-fraction convergents.

Try it live

Everything above runs in your browser — open Ford Circles & Farey Sequence and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Ford Circles & Farey Sequence simulation

What did you find?

Add reproduction steps (optional)