Today we shall look at a class of sequences with a rich and deep history beginning from their earliest appearance in a problem that appeared in the Ladies’ Diary, which have numerous applications in number theory and combinatorics, and are lately making an appearance in math Olympiad problems.
The Farey sequence of order , denoted
is the sequence of completely reduced fractions, usually between 0 and 1, which have denominators less than or equal to
, arranged in order of increasing size. For example,
1. Basic Properties
First, observe that the terms which appear in the Farey sequence of order have denominators
(which is of course obvious from the definition) and since they are completely reduced, the numerators are coprime to the denominators. Thus, there exists exactly
fractions with denominator
for all
and indeed, the Farey sequence of order
has exactly
terms.
Summing across the fractions with the same denominator by pairing, it is also not hard to show that the sum of fractions in the Farey sequence of order is equal to
, solving this unsourced problem from AoPS.
We shall now look at a few well known properties of the Farey sequences.
Theorem 1 (Farey Neighbours)
The fractions and
are neighbours in a Farey sequence if and only if
or equivalently,
.
We give two proofs of this result, each interesting in it’s own right.
First proof, bounding. Consider a term in a Farey sequence. We shall determine the next term in the Farey sequence. Since
, there exists integers
and
satisfying the equation,
by Bezout’s Lemma. In particular, if is a pair of solutions, then all pairs of the form
where
is an integer are also solutions. We can now consider
such that
and look at the pair
and
. Since this is a pair of solutions to the above equation,
so
is a member of
.
Clearly, so
appears after
in
. Now, let
be the next term in the Farey sequence
. If this is distinct from
, then
and we have
and
.
However, this is an immediate contradiction since
.
where follows by our choice of
.
Second proof, geometric. The idea is to represent the fraction by the ordered pair of integers
and throw it on the lattice plane.
We say a point is visible if the line segment does not contain any lattice points in it’s strict interior. It is not hard to see that the point
is visible if and only if
. This means that the set of fractions in the Farey sequences of order at most
corresponds exactly to the set of visible points in the region
bounded by the lines
,
and
.
Now, consider a moving line passing through the origin
and rotating clockwise. It is clear that passes through the visible points
in decreasing order of
since
where denotes the
−axis.
Let and
be two points on which lands consecutively. Since there exists no visible points within the angle
it is not hard to see that there exists no visible points (and hence no lattice points) within the parallelogram
. By Pick’s Theorem it then follows that the area of the parallelogram
is 1.

We can alternately calculate the area of the parallelogram as,
which implies the result.
This is already sufficient to solve the following interesting problem given at a mock for the China National HS Math League and 2002 Kürschák Problem 2 which uses the cool result that the ratios of consecutive Fibonacci numbers are also consecutive Farey fractions.
An immediate corollary of this result is the fact that if the fractions are a trio of neighbours in a Farey sequence, then
which can be verified by applying the above property on each pair of neighbours.
Another observation is that must be completely reduced since otherwise, this fraction lies strictly between
and
and has denominator at most
.
Theorem 2 (Mediant Property)
If and
are neighbours in a Farey sequence then the first term that appears
between them as the order of the Farey sequence is incremented is their mediant,
.
Proof. If exactly one new fraction appears between and
this follows from the above corollary. Hence, at least two new fractions must appear. However it is not hard to see
that the newly added terms in the Farey sequence of order $n$ must all have denominator $n$.
If for some strictly positive integer
note that
and
so
and we have which since
by the Farey neighbour’s condition implies
which is a clear contradiction.
Surprisingly, this result has also appeared in recent olympiads, most notably as 2024 Mexico TST Problem 1.
This result is crucial since it allows us to iteratively construct all terms that appear in a Farey sequence (and by extension all rationals between 0 and 1).
Starting with and
, placed at either end of a segment of length 1, in each step write the mediants of each pair of neighbouring fractions at the midpoint of their positions. Optionally, one can write the fractions generated in each step in a new level. This structure is sometimes refered to as the Stern-Brocot tree (when all edges are deleted except those between a fraction and it’s two children) or the Neighbour’s graph of Farey fractions. Given below is the graph upto 5 generations, with terms greater than 1 included.

We can immediately note that this graph is outerplanar — in each stage, the newly added vertices are connected to two neighbouring vertices which belong to the outer face. Since it is well known that outerplanar graphs on vertices have at most
edges, this immediately solves 2020 USAMO Problem 4.
Another important application of the Farey sequence is it’s connection to continued fractions and rational approximations.
2. Diophantine Approximations
By the denseness of the rational numbers, we know that for every irrational number and
, there exists integers
and
with
.
For example, consider . Clearly,
is a really good rational approximation but this is pointless. The goal is to obtain as close an approximation as possible, using small denominators.
Theorem 3 (Weak Diophantine Approximation)
For every positive irrational number , there exists infinitely many pairs of integers
such that
.
Proof. The idea is to consider for each positive integer , the positive integer
such that
and pick the fraction which is closer to
. The interval
is of length
meaning that our approximation is off by at worst
, as desired.
First of all, the fact that such an approximation exists for every positive integral denominator is a red light, and indeed these approximations are not very good. For example, to get an approximation for
that is at most
off, we need to use a denominator of at least
which is barely any better than what we started with.
Using the knowledge of Farey fractions however, it is possible to significantly improve this approximation.
Theorem 4 (Strong Diophantine Approximation)
For every positive irrational number , there exists infinitely many pairs of integers
such that
.
Proof. We only consider the case when , it is easy to see that the others follow by shifting. Since
is in this range, it must lie strictly between two terms of the Farey sequence of order
, say
.
By the AM-GM inequality we know that
,
the latter equality following from the Farey Neighbour’s theorem. However this means
so one of the inequalities and
must hold. Moreover, as the order of the Farey sequence increases, every rational number between 0 and 1 appears, and we obtain infinitely many (increasingly better) approximations of
.
Surprisingly, we can do yet better solely employing Farey fractions by being a little smarter.
Theorem 5 (Hurwitz’s Approximation)
For every positive irrational number , there exists infinitely many pairs of integers
such that
.
Proof. As before, consider the case when and let
lie strictly between the Farey neighbours
and
. In particular, since
it is clear that
must lie strictly within one of these two intervals. Without loss of generality, assume it lies strictly between
and
.
Working towards a contradiction, assume that each of the inequalities ,
and
hold.
However, adding the third inequality with each of the other two in turn yields,
and
utilizing both the Farey neighbours and Mediant properties. Thus, and
. Summing these two inequalities we have,
which rearranges to
which is a clear violation of the trivial inequality unless equality holds. However, equality cannot hold since
is irrational, and the result follows.
It is in fact also known that is the best constant
such that for every irrational number
, there exists infinitely many integers
such that
. This is because for larger
, the ‘golden ratio’
ceases to have infinitely many approximations. This is part of the reason why the golden ratio is said to be in some sense ‘the most irrational number’.
The equality case is also quite interesting since one can show that all rational approximations of satisfying Hurwitz’s approximation are those which are ratios of consecutive Fibonacci numbers.
3. Ford Circles
Since any discussion on Farey sequences is incomplete without mentioning Ford circles, we shall point out a few connections between the two.

Ford circles are a set of circles whose centers are at and have radius
for every completely reduced fraction
between 0 and 1.
Theorem 6 (Ford Circles)
Two Ford circles are either disjoint or tangent to each other. In particular, the Ford circles for two completely reduced fractions are tangent if and only if these fractions are neighbours of some Farey sequence.
Proof. We employ Cartesian coordinates. With the center and radii all known, this is but a simple calculation. We know that two circles intersect if and only if the sum of their radii is less than the distance between their centers.
However,
which is negative if and only if or simply
which is a clear contradiction, and in particular tangency holds if and only if
which is precisely the Farey neighbours condition.