Farey sequence
Encyclopedia
In mathematics
, the Farey sequence of order n is the sequence
of completely reduced fractions between 0 and 1 which, when in lowest terms, have denominators less than or equal to n, arranged in order of increasing size.
Each Farey sequence starts with the value 0, denoted by the fraction 0⁄1, and ends with the value 1, denoted by the fraction 1⁄1 (although some authors omit these terms).
A Farey sequence is sometimes called a Farey series
, which is not strictly correct, because the terms are not summed.
Farey sequences are named after the British
geologist
John Farey, Sr.
, whose letter about these sequences was published in the Philosophical Magazine
in 1816. Farey conjectured, without offering proof, that each new term in a Farey sequence expansion is the mediant of its neighbours. Farey's letter was read by Cauchy, who provided a proof in his Exercises de mathématique, and attributed this result to Farey. In fact, another mathematician, Charles Haros
, had published similar results in 1802 which were not known either to Farey or to Cauchy. Thus it was a historical accident that linked Farey's name with these sequences.
to n. Thus F6 consists of F5 together with the fractions 1⁄6 and 5⁄6. The middle term of a Farey sequence Fn is always 1⁄2, for n > 1.
From this, we can relate the lengths of Fn and Fn−1 using Euler's totient function
φ(n) :
Using the fact that |F1| = 2, we can derive an expression for the length of Fn :
The asymptotic behaviour of |Fn| is :
If a⁄b and c⁄d are neighbours in a Farey sequence, with a⁄b < c⁄d, then their difference c⁄d − a⁄b is equal to 1⁄bd. Since
this is equivalent to saying that
Thus 1⁄3 and 2⁄5 are neighbours in F5, and their difference is 1⁄15.
The converse is also true. If
for positive integers a,b,c and d with a < b and c < d then a⁄b and c⁄d will be neighbours in the Farey sequence of order max(b,d).
If p⁄q has neighbours a⁄b and c⁄d in some Farey sequence, with
then p⁄q is the mediant of a⁄b and c⁄d — in other words,
This follows easily from the previous property, since if bp-aq = qc-pd = 1, then bp+pd = qc+aq, p(b+d)=q(a+c), p/q = (a+c)/(b+d)
It follows that if a⁄b and c⁄d are neighbours in a Farey sequence then the first term that appears between them as the order of the Farey sequence is increased is
which first appears in the Farey sequence of order b + d.
Thus the first term to appear between 1⁄3 and 2⁄5 is 3⁄8, which appears in F8.
The Stern-Brocot tree
is a data structure showing how the sequence is built up from 0 (= 0⁄1) and 1 (= 1⁄1), by taking successive mediants.
Fractions that appear as neighbours in a Farey sequence have closely related continued fraction
expansions. Every fraction has two continued fraction expansions — in one the final term is 1; in the other the final term is greater than 1. If p⁄q, which first appears in Farey sequence Fq, has continued fraction expansions
then the nearest neighbour of p⁄q in Fq (which will be its neighbour with the larger denominator) has a continued fraction expansion
and its other neighbour has a continued fraction expansion
Thus 3⁄8 has the two continued fraction expansions [0; 2, 1, 1, 1] and [0; 2, 1, 2], and its neighbours in F8 are 2⁄5, which can be expanded as [0; 2, 1, 1]; and 1⁄3, which can be expanded as [0; 2, 1].
s.
For every fraction p/q (in its lowest terms) there is a Ford circle C[p/q], which is the circle with radius 1/(2q2) and centre at (p/q, 1/(2q2)). Two Ford circles for different fractions are either disjoint or they are tangent
to one another—two Ford circles never intersect. If 0 < p/q < 1 then the Ford circles that are tangent to C[p/q] are precisely the Ford circles for fractions that are neighbours of p/q in some Farey sequence.
Thus C[2/5] is tangent to C[1/2], C[1/3], C[3/7], C[3/8] etc.
. Suppose the terms of are . Define , in other words is the difference between the kth term of the nth Farey sequence, and the kth member of a set of the same number of points, distributed evenly on the unit interval. Franel and Landau
proved that the two statements that
for any r > 1/2, and that
for any r > −1, are equivalent to the Riemann hypothesis.
This is implemented in Python
as:
Brute-force searches for solutions to Diophantine equation
s in rationals can often take advantage of the Farey series (to search only reduced forms). The lines marked (*) can also be modified to include any two adjacent terms so as to generate terms only larger (or smaller) than a given term.
Mathematics
Mathematics is the study of quantity, space, structure, and change. Mathematicians seek out patterns and formulate new conjectures. Mathematicians resolve the truth or falsity of conjectures by mathematical proofs, which are arguments sufficient to convince other mathematicians of their validity...
, the Farey sequence of order n is the sequence
Sequence
In mathematics, a sequence is an ordered list of objects . Like a set, it contains members , and the number of terms is called the length of the sequence. Unlike a set, order matters, and exactly the same elements can appear multiple times at different positions in the sequence...
of completely reduced fractions between 0 and 1 which, when in lowest terms, have denominators less than or equal to n, arranged in order of increasing size.
Each Farey sequence starts with the value 0, denoted by the fraction 0⁄1, and ends with the value 1, denoted by the fraction 1⁄1 (although some authors omit these terms).
A Farey sequence is sometimes called a Farey series
Series (mathematics)
A series is the sum of the terms of a sequence. Finite sequences and series have defined first and last terms, whereas infinite sequences and series continue indefinitely....
, which is not strictly correct, because the terms are not summed.
Examples
The Farey sequences of orders 1 to 8 are :- F1 = {0⁄1, 1⁄1}
- F2 = {0⁄1, 1⁄2, 1⁄1}
- F3 = {0⁄1, 1⁄3, 1⁄2, 2⁄3, 1⁄1}
- F4 = {0⁄1, 1⁄4, 1⁄3, 1⁄2, 2⁄3, 3⁄4, 1⁄1}
- F5 = {0⁄1, 1⁄5, 1⁄4, 1⁄3, 2⁄5, 1⁄2, 3⁄5, 2⁄3, 3⁄4, 4⁄5, 1⁄1}
- F6 = {0⁄1, 1⁄6, 1⁄5, 1⁄4, 1⁄3, 2⁄5, 1⁄2, 3⁄5, 2⁄3, 3⁄4, 4⁄5, 5⁄6, 1⁄1}
- F7 = {0⁄1, 1⁄7, 1⁄6, 1⁄5, 1⁄4, 2⁄7, 1⁄3, 2⁄5, 3⁄7, 1⁄2, 4⁄7, 3⁄5, 2⁄3, 5⁄7, 3⁄4, 4⁄5, 5⁄6, 6⁄7, 1⁄1}
- F8 = {0⁄1, 1⁄8, 1⁄7, 1⁄6, 1⁄5, 1⁄4, 2⁄7, 1⁄3, 3⁄8, 2⁄5, 3⁄7, 1⁄2, 4⁄7, 3⁄5, 5⁄8, 2⁄3, 5⁄7, 3⁄4, 4⁄5, 5⁄6, 6⁄7, 7⁄8, 1⁄1}
History
- The history of 'Farey series' is very curious — Hardy & Wright (1979) Chapter III
- ... once again the man whose name was given to a mathematical relation was not the original discoverer so far as the records go. — Beiler (1964) Chapter XVI
Farey sequences are named after the British
United Kingdom
The United Kingdom of Great Britain and Northern IrelandIn the United Kingdom and Dependencies, other languages have been officially recognised as legitimate autochthonous languages under the European Charter for Regional or Minority Languages...
geologist
Geologist
A geologist is a scientist who studies the solid and liquid matter that constitutes the Earth as well as the processes and history that has shaped it. Geologists usually engage in studying geology. Geologists, studying more of an applied science than a theoretical one, must approach Geology using...
John Farey, Sr.
John Farey, Sr.
John Farey, Sr. was an English geologist and writer. However, he is better known for a mathematical construct, the Farey sequence named after him.-Biography:...
, whose letter about these sequences was published in the Philosophical Magazine
Philosophical Magazine
The Philosophical Magazine is one of the oldest scientific journals published in English. Initiated by Alexander Tilloch in 1798, in 1822 Richard Taylor became joint editor and it has been published continuously by Taylor & Francis ever since; it was the journal of choice for such luminaries as...
in 1816. Farey conjectured, without offering proof, that each new term in a Farey sequence expansion is the mediant of its neighbours. Farey's letter was read by Cauchy, who provided a proof in his Exercises de mathématique, and attributed this result to Farey. In fact, another mathematician, Charles Haros
Charles Haros
Charles Haros was a geometer in the French Bureau du Cadastre at the end of the eighteenth century and the beginning of the nineteenth century.- Haros' conversion table :...
, had published similar results in 1802 which were not known either to Farey or to Cauchy. Thus it was a historical accident that linked Farey's name with these sequences.
Sequence length
The Farey sequence of order n contains all of the members of the Farey sequences of lower orders. In particular Fn contains all of the members of Fn−1, and also contains an additional fraction for each number that is less than n and coprimeCoprime
In number theory, a branch of mathematics, two integers a and b are said to be coprime or relatively prime if the only positive integer that evenly divides both of them is 1. This is the same thing as their greatest common divisor being 1...
to n. Thus F6 consists of F5 together with the fractions 1⁄6 and 5⁄6. The middle term of a Farey sequence Fn is always 1⁄2, for n > 1.
From this, we can relate the lengths of Fn and Fn−1 using Euler's totient function
Euler's totient function
In number theory, the totient \varphi of a positive integer n is defined to be the number of positive integers less than or equal to n that are coprime to n In number theory, the totient \varphi(n) of a positive integer n is defined to be the number of positive integers less than or equal to n that...
φ(n) :
Using the fact that |F1| = 2, we can derive an expression for the length of Fn :
The asymptotic behaviour of |Fn| is :
Farey neighbours
Fractions which are neighbouring terms in any Farey sequence are known as a Farey pair and have the following properties.If a⁄b and c⁄d are neighbours in a Farey sequence, with a⁄b < c⁄d, then their difference c⁄d − a⁄b is equal to 1⁄bd. Since
this is equivalent to saying that
- bc − ad = 1.
Thus 1⁄3 and 2⁄5 are neighbours in F5, and their difference is 1⁄15.
The converse is also true. If
- bc − ad = 1
for positive integers a,b,c and d with a < b and c < d then a⁄b and c⁄d will be neighbours in the Farey sequence of order max(b,d).
If p⁄q has neighbours a⁄b and c⁄d in some Farey sequence, with
- a⁄b < p⁄q < c⁄d
then p⁄q is the mediant of a⁄b and c⁄d — in other words,
This follows easily from the previous property, since if bp-aq = qc-pd = 1, then bp+pd = qc+aq, p(b+d)=q(a+c), p/q = (a+c)/(b+d)
It follows that if a⁄b and c⁄d are neighbours in a Farey sequence then the first term that appears between them as the order of the Farey sequence is increased is
which first appears in the Farey sequence of order b + d.
Thus the first term to appear between 1⁄3 and 2⁄5 is 3⁄8, which appears in F8.
The Stern-Brocot tree
Stern-Brocot tree
In number theory, the Stern–Brocot tree is an infinite complete binary tree in which the vertices correspond precisely to the positive rational numbers, whose values are ordered from left to right as in a search tree....
is a data structure showing how the sequence is built up from 0 (= 0⁄1) and 1 (= 1⁄1), by taking successive mediants.
Fractions that appear as neighbours in a Farey sequence have closely related continued fraction
Continued fraction
In mathematics, a continued fraction is an expression obtained through an iterative process of representing a number as the sum of its integer part and the reciprocal of another number, then writing this other number as the sum of its integer part and another reciprocal, and so on...
expansions. Every fraction has two continued fraction expansions — in one the final term is 1; in the other the final term is greater than 1. If p⁄q, which first appears in Farey sequence Fq, has continued fraction expansions
- [0; a1, a2, …, an − 1, an, 1]
- [0; a1, a2, …, an − 1, an + 1]
then the nearest neighbour of p⁄q in Fq (which will be its neighbour with the larger denominator) has a continued fraction expansion
- [0; a1, a2, …, an]
and its other neighbour has a continued fraction expansion
- [0; a1, a2, …, an − 1]
Thus 3⁄8 has the two continued fraction expansions [0; 2, 1, 1, 1] and [0; 2, 1, 2], and its neighbours in F8 are 2⁄5, which can be expanded as [0; 2, 1, 1]; and 1⁄3, which can be expanded as [0; 2, 1].
Ford circles
There is an interesting connection between Farey sequence and Ford circleFord circle
In mathematics, a Ford circle is a circle with centre at and radius 1/, where p/q is an irreducible fraction, i.e. p and q are coprime integers...
s.
For every fraction p/q (in its lowest terms) there is a Ford circle C[p/q], which is the circle with radius 1/(2q2) and centre at (p/q, 1/(2q2)). Two Ford circles for different fractions are either disjoint or they are tangent
Tangent
In geometry, the tangent line to a plane curve at a given point is the straight line that "just touches" the curve at that point. More precisely, a straight line is said to be a tangent of a curve at a point on the curve if the line passes through the point on the curve and has slope where f...
to one another—two Ford circles never intersect. If 0 < p/q < 1 then the Ford circles that are tangent to C[p/q] are precisely the Ford circles for fractions that are neighbours of p/q in some Farey sequence.
Thus C[2/5] is tangent to C[1/2], C[1/3], C[3/7], C[3/8] etc.
Riemann hypothesis
Farey sequences are used in two equivalent formulations of the Riemann hypothesisRiemann hypothesis
In mathematics, the Riemann hypothesis, proposed by , is a conjecture about the location of the zeros of the Riemann zeta function which states that all non-trivial zeros have real part 1/2...
. Suppose the terms of are . Define , in other words is the difference between the kth term of the nth Farey sequence, and the kth member of a set of the same number of points, distributed evenly on the unit interval. Franel and Landau
Edmund Landau
Edmund Georg Hermann Landau was a German Jewish mathematician who worked in the fields of number theory and complex analysis.-Biography:...
proved that the two statements that
for any r > 1/2, and that
for any r > −1, are equivalent to the Riemann hypothesis.
Next term
A surprisingly simple algorithm exists to generate the terms in either traditional order (ascending) or non-traditional order (descending). The algorithm computes each successive entry in terms of the previous two entries using the mediant property given above. If a/b and c/d are the two given entries, and p/q is the unknown next entry, then c/d = (a + p)/(b + q). c/d is in lowest terms, so there is an integer k such that kc = a + p and kd = b + q, giving p = kc − a and q = kd − b. The value of k must give a value of p/q which is as close as possible to c/d, which implies that k must be as large as possible subject to kd − b ≤ n, so k is the greatest integer ≤ (n + b)/d. In other words, k = (n+b)/d, andThis is implemented in Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
as:
Brute-force searches for solutions to Diophantine equation
Diophantine equation
In mathematics, a Diophantine equation is an indeterminate polynomial equation that allows the variables to be integers only. Diophantine problems have fewer equations than unknown variables and involve finding integers that work correctly for all equations...
s in rationals can often take advantage of the Farey series (to search only reduced forms). The lines marked (*) can also be modified to include any two adjacent terms so as to generate terms only larger (or smaller) than a given term.
Further reading
- Ronald L. Graham, Donald E. Knuth, and Oren PatashnikOren PatashnikOren Patashnik is a computer scientist. He is notable for co-creating BibTeX, and co-writing Concrete Mathematics: A Foundation for Computer Science...
, Concrete Mathematics: A Foundation for Computer Science, 2nd Edition (Addison-Wesley, Boston, 1989); in particular, Sec. 4.5 (pp. 115–123), Bonus Problem 4.61 (pp. 150, 523–524), Sec. 4.9 (pp. 133–139), Sec. 9.3, Problem 9.3.6 (pp. 462–463). ISBN 0201558025. - Linas Vepstas. The Minkowski Question Mark, GL(2,Z), and the Modular Group. http://linas.org/math/chap-minkowski.pdf reviews the isomorphisms of the Stern-Brocot Tree.
- Linas Vepstas. Symmetries of Period-Doubling Maps. http://linas.org/math/chap-takagi.pdf reviews connections between Farey Fractions and Fractals.
- Scott B. Guthery, A Motif of Mathematics: History and Application of the Mediant and the Farey Sequence, (Docent Press, Boston, 2010). ISBN 1453810579.
External links
- Alexander Bogomolny. Farey series and Stern-Brocot Tree at Cut-the-KnotCut-the-knotCut-the-knot is a free, advertisement-funded educational website maintained by Alexander Bogomolny and devoted to popular exposition of many topics in mathematics. The site has won more than 20 awards from scientific and educational publications, including a Scientific American Web Award in 2003,...
- Farey Sequence from The On-Line Encyclopedia of Integer Sequences.