← Iris
Lab › Number Theory

Farey Sequence & Ford Circles

The Farey sequence F_n contains all fractions p/q with 0 ≤ p/q ≤ 1 and q ≤ n, in ascending order. Above each fraction sits a Ford circle — tangent to the x-axis and to the circles of its Farey neighbors. The result is a fractal packing.

Mediant property: if p/q and p'/q' are adjacent in F_n then p'q − pq' = 1  |  Ford circle of p/q has radius 1/(2q²) and center (p/q, 1/(2q²))


The Farey sequence was named after geologist John Farey, who noticed in 1816 that each fraction is the mediant (sum of numerators over sum of denominators) of its neighbors. The key property: adjacent fractions a/b and c/d satisfy |bc − ad| = 1.

Ford circles, named after mathematician Lester Ford (1938), are circles of radius 1/(2q²) centered at (p/q, 1/(2q²)) for each fraction p/q. The circles of adjacent Farey fractions are tangent to each other, forming an Apollonian gasket — an example of fractal circle packing.

The Stern-Brocot tree is a binary tree containing every positive rational number exactly once. It is constructed by starting with 0/1 and 1/0 (infinity) and repeatedly inserting the mediant between adjacent fractions. Every rational corresponds to a unique path through the tree.