Continued Fractions & Farey

The Stern-Brocot tree organizes all rationals by their continued fraction expansions. The Farey sequence F_n contains all fractions p/q with q≤n. Click any node to see its continued fraction.

4
6
Click a node in the tree to see its continued fraction expansion.

Mediant property: between p/q and r/s, the simplest fraction is (p+r)/(q+s). This IS the Euclidean algorithm.