HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, the Farey sequence of order ''n'' is the
sequence In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is cal ...
of completely reduced
fraction A fraction (from , "broken") represents a part of a whole or, more generally, any number of equal parts. When spoken in everyday English, a fraction describes how many parts of a certain size there are, for example, one-half, eight-fifths, thre ...
s, either between 0 and 1, or without this restriction, which have
denominator A fraction (from , "broken") represents a part of a whole or, more generally, any number of equal parts. When spoken in everyday English, a fraction describes how many parts of a certain size there are, for example, one-half, eight-fifths, thre ...
s less than or equal to ''n'', arranged in order of increasing size. With the restricted definition, each Farey sequence starts with the value 0, denoted by the fraction , and ends with the value 1, denoted by the fraction (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.


Examples

The Farey sequences of orders 1 to 8 are : :''F''1 = :''F''2 = :''F''3 = :''F''4 = :''F''5 = :''F''6 = :''F''7 = :''F''8 =


Farey sunburst

Plotting the numerators versus the denominators of a Farey sequence gives a shape like the one to the right, shown for Reflecting this shape around the diagonal and main axes generates the ''Farey sunburst'', shown below. The Farey sunburst of order connects the visible integer grid points from the origin in the square of side , centered at the origin. Using Pick's theorem, the area of the sunburst is , where is the number of fractions in .


History

:''The history of 'Farey series' is very curious'' — Hardy & Wright (1979) :''... 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) Cited in Farey sequences are named after the
British British may refer to: Peoples, culture, and language * British people, nationals or natives of the United Kingdom, British Overseas Territories and Crown Dependencies. * British national identity, the characteristics of British people and culture ...
geologist A geologist is a scientist who studies the structure, composition, and History of Earth, history of Earth. Geologists incorporate techniques from physics, chemistry, biology, mathematics, and geography to perform research in the Field research, ...
John Farey, Sr., whose letter about these sequences was published in the ''
Philosophical Magazine The ''Philosophical Magazine'' is one of the oldest scientific journals published in English. It was established by Alexander Tilloch in 1798;John Burnett"Tilloch, Alexander (1759–1825)" Dictionary of National Biography#Oxford Dictionary of ...
'' in 1816. Farey conjectured, without offering proof, that each new term in a Farey sequence expansion is the
mediant In music, the mediant (''Latin'': "being in the middle") is the third scale degree () of a diatonic scale, being the note halfway between the tonic and the dominant.Benward & Saker (2003), p.32. In the movable do solfège system, the mediant no ...
of its neighbours. Farey's letter was read by
Cauchy Baron Augustin-Louis Cauchy ( , , ; ; 21 August 1789 – 23 May 1857) was a French mathematician, engineer, and physicist. He was one of the first to rigorously state and prove the key theorems of calculus (thereby creating real a ...
, who provided a proof in his ''Exercices 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. This is an example of Stigler's law of eponymy.


Properties


Sequence length and index of a fraction

The Farey sequence of order contains all of the members of the Farey sequences of lower orders. In particular contains all of the members of and also contains an additional fraction for each number that is less than and
coprime In number theory, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equiv ...
to . Thus consists of together with the fractions and . The middle term of a Farey sequence is always , for . From this, we can relate the lengths of and using
Euler's totient function In number theory, Euler's totient function counts the positive integers up to a given integer that are relatively prime to . It is written using the Greek letter phi as \varphi(n) or \phi(n), and may also be called Euler's phi function. In ot ...
: , F_n, = , F_, + \varphi(n). Using the fact that , we can derive an expression for the length of : , F_n, = 1 + \sum_^n \varphi(m) = 1 + \Phi(n), where is the summatory totient. We also have : , F_n, = \frac\left(3+\sum_^n \mu(d) \left\lfloor \tfrac \right\rfloor^2 \right), and by a
Möbius inversion formula In mathematics, the classic Möbius inversion formula is a relation between pairs of arithmetic functions, each defined from the other by sums over divisors. It was introduced into number theory in 1832 by August Ferdinand Möbius. A large genera ...
: , F_n, = \frac (n+3)n - \sum_^n, F_, , where is the number-theoretic
Möbius function The Möbius function \mu(n) is a multiplicative function in number theory introduced by the German mathematician August Ferdinand Möbius (also transliterated ''Moebius'') in 1832. It is ubiquitous in elementary and analytic number theory and m ...
, and \lfloor n/d \rfloor is the
floor function In mathematics, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least integer greater than or eq ...
. The asymptotic behaviour of is : , F_n, \sim \frac . The number of Farey fractions with denominators equal to in is given by when and zero otherwise. Concerning the numerators one can define the function \mathcal_n(h) that returns the number of Farey fractions with numerators equal to in . This function has some interesting properties as :\mathcal_n(1)=n, :\mathcal_n(p^m)=\left\lceil(n-p^m) \left(1- 1/p \right)\right\rceil for any prime number p, :\mathcal_(h)=\mathcal_(h) + m\varphi(h) for any integer , :\mathcal_(4h)=\mathcal_(2h) - \varphi(2h). In particular, the property in the third line above implies \mathcal_(h)=(m-1)\varphi(h) and, further, \mathcal_(h)=\varphi(h). The latter means that, for Farey sequences of even order , the number of fractions with numerators equal to is the same as the number of fractions with denominators equal to , that is \mathcal_(n/2) = \varphi(n/2). The index I_n(a_) = k of a fraction a_ in the Farey sequence F_n=\ is simply the position that a_ occupies in the sequence. This is of special relevance as it is used in an alternative formulation of the
Riemann hypothesis In mathematics, the Riemann hypothesis is the conjecture that the Riemann zeta function has its zeros only at the negative even integers and complex numbers with real part . Many consider it to be the most important unsolved problem in pure ...
, see
below Below may refer to: *Earth *Ground (disambiguation) *Soil *Floor * Bottom (disambiguation) *Less than *Temperatures below freezing *Hell or underworld People with the surname * Ernst von Below (1863–1955), German World War I general * Fred Belo ...
. Various useful properties follow: \begin I_n(0/1) &= 0, \\ pt I_n(1/n) &= 1, \\ pt I_n(1/2) &= \frac, \\ pt I_n(1/1) &= , F_n, -1 , \\ pt I_n(h/k) &= , F_n, -1 - I_n\left(\frac\right). \end The index of where and is the
least common multiple In arithmetic and number theory, the least common multiple (LCM), lowest common multiple, or smallest common multiple (SCM) of two integers ''a'' and ''b'', usually denoted by , is the smallest positive integer that is divisible by both ''a'' and ...
of the first numbers, , is given by: I_n(1/k) = 1 + n \sum_^ \frac - k\Phi(i). A similar expression was used as an approximation of I_n(x) for low values of x in the classical paper by F. Dress. A general expression for I_n(h/k) for any Farey fraction h/k is given in.


Farey neighbours

Fractions which are neighbouring terms in any Farey sequence are known as a ''Farey pair'' and have the following properties. If and are neighbours in a Farey sequence, with , then their difference is equal to . Since \frac - \frac = \frac, this is equivalent to saying that bc - ad = 1. Thus and are neighbours in , and their difference is . The converse is also true. If bc - ad = 1 for positive integers with and , then and will be neighbours in the Farey sequence of order . If has neighbours and in some Farey sequence, with , then is the
mediant In music, the mediant (''Latin'': "being in the middle") is the third scale degree () of a diatonic scale, being the note halfway between the tonic and the dominant.Benward & Saker (2003), p.32. In the movable do solfège system, the mediant no ...
of and – in other words, \frac = \frac. This follows easily from the previous property, since if \begin && bp - aq &= qc - pd = 1, \\ pt \implies && bp + pd &= qc + aq, \\ pt \implies && p(b + d) &= q(a + c), \\ \implies && \frac &= \frac. \end It follows that 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 \frac, which first appears in the Farey sequence of order . Thus the first term to appear between and is , which appears in . The total number of Farey neighbour pairs in is . The ''
Stern–Brocot tree In number theory, the Stern–Brocot tree is an infinite complete binary tree in which the vertices correspond one-for-one to the positive rational numbers, whose values are ordered from the left to the right as in a binary search tree. The ...
'' is a data structure showing how the sequence is built up from 0 and 1 , by taking successive mediants.


Equivalent-area interpretation

Every consecutive pair of Farey rationals have an equivalent area of 1. See this by interpreting consecutive rationals r_1 = \frac \qquad r_2 = \frac as vectors in the xy-plane. The area is given by A \left(\frac, \frac \right) = qp' - q'p. As any added fraction in between two previous consecutive Farey sequence fractions is calculated as the
mediant In music, the mediant (''Latin'': "being in the middle") is the third scale degree () of a diatonic scale, being the note halfway between the tonic and the dominant.Benward & Saker (2003), p.32. In the movable do solfège system, the mediant no ...
(⊕), then \begin A(r_1, r_1 \oplus r_2) &= A(r_1, r_1) + A(r_1, r_2) \\ &= A(r_1, r_2) \\ &= 1 \end (since and , its area must be 1).


Farey neighbours and continued fractions

Fractions that appear as neighbours in a Farey sequence have closely related
continued fraction A continued fraction is a mathematical expression that can be written as a fraction with a denominator that is a sum that contains another simple or continued fraction. Depending on whether this iteration terminates with a simple fraction or not, ...
expansions. Every fraction has two continued fraction expansions — in one the final term is 1; in the other the final term is greater by 1. If , which first appears in Farey sequence , has the continued fraction expansions \begin & ;\ a_1,\ a_2,\ \ldots,\ a_,\ a_n,\ 1\\ & ;\ a_1,\ a_2,\ \ldots,\ a_,\ a_n + 1\end then the nearest neighbour of in (which will be its neighbour with the larger denominator) has a continued fraction expansion ;\ a_1,\ a_2,\ \ldots,\ a_n/math> and its other neighbour has a continued fraction expansion ;\ a_1,\ a_2,\ \ldots,\ a_/math> For example, has the two continued fraction expansions and , and its neighbours in are , which can be expanded as ; and , which can be expanded as .


Farey fractions and the least common multiple

The lcm can be expressed as the products of Farey fractions as \text ,2,...,N= e^ = \frac \left( \prod_ 2 \sin(\pi r) \right)^2 where is the second Chebyshev function.


Farey fractions and the greatest common divisor

Since the
Euler's totient function In number theory, Euler's totient function counts the positive integers up to a given integer that are relatively prime to . It is written using the Greek letter phi as \varphi(n) or \phi(n), and may also be called Euler's phi function. In ot ...
is directly connected to the gcd so is the number of elements in , , F_n, = 1 + \sum_^n \varphi(m) = 1+ \sum\limits_^ \sum\limits_^m \gcd(k,m) \cos . For any 3 Farey fractions the following identity between the gcd's of the 2x2 matrix determinants in absolute value holds: \gcd\left(\begin a & c\\b & d \end, \begin a & e\\b & f \end \right) = \gcd\left(\begin a & c\\b & d \end, \begin c & e\\d & f \end \right) = \gcd\left(\begin a & e\\b & f \end, \begin c & e\\d & f \end \right)


Applications

Farey sequences are very useful to find rational approximations of irrational numbers. For example, the construction by Eliahou of a lower bound on the length of non-trivial cycles in the 3''x''+1 process uses Farey sequences to calculate a continued fraction expansion of the number . In physical systems with resonance phenomena, Farey sequences provide a very elegant and efficient method to compute resonance locations in 1D and 2D. Farey sequences are prominent in studies of
any-angle path planning Any-angle path planning algorithms are pathfinding algorithms that search for a Euclidean shortest path between two points on a grid map while allowing the turns in the path to have any angle. The result is a path that cuts directly through ope ...
on square-celled grids, for example in characterizing their computational complexity or optimality. The connection can be considered in terms of -constrained paths, namely paths made up of line segments that each traverse at most rows and at most columns of cells. Let be the set of vectors such that 1 \leq q \leq r, 0 \leq p \leq q, and , are coprime. Let be the result of reflecting in the line . Let S = \. Then any -constrained path can be described as a sequence of vectors from . There is a bijection between and the Farey sequence of order given by mapping to \tfrac.


Ford circles

There is a connection between Farey sequence and Ford circles. For every fraction (in its lowest terms) there is a Ford circle , which is the circle with radius \tfrac and centre at \bigl(\tfrac, \tfrac\bigr). Two Ford circles for different fractions are either disjoint or they are
tangent In geometry, the tangent line (or simply tangent) to a plane curve at a given point is, intuitively, the straight line that "just touches" the curve at that point. Leibniz defined it as the line through a pair of infinitely close points o ...
to one another—two Ford circles never intersect. If then the Ford circles that are tangent to are precisely the Ford circles for fractions that are neighbours of in some Farey sequence. Thus is tangent to , , , , etc. Ford circles appear also in the Apollonian gasket . The picture below illustrates this together with Farey resonance lines.


Riemann hypothesis

Farey sequences are used in two equivalent formulations of the
Riemann hypothesis In mathematics, the Riemann hypothesis is the conjecture that the Riemann zeta function has its zeros only at the negative even integers and complex numbers with real part . Many consider it to be the most important unsolved problem in pure ...
. Suppose the terms of are \. Define d_ = a_ - \tfrac, in other words d_ is the difference between the th term of the th Farey sequence, and the th member of a set of the same number of points, distributed evenly on the unit interval. In 1924
Jérôme Franel Jérôme Franel (1859–1939) was a Swiss mathematician who specialised in analytic number theory. He is mainly known through a 1924 paper, in which he establishes the equivalence of the Riemann hypothesis to a statement on the size of the discre ...
proved that the statement \sum_^ d_^2 = O (n^r) \quad \forall r > -1 is equivalent to the Riemann hypothesis, and then
Edmund Landau Edmund Georg Hermann Landau (14 February 1877 – 19 February 1938) was a German mathematician who worked in the fields of number theory and complex analysis. Biography Edmund Landau was born to a Jewish family in Berlin. His father was Leopo ...
remarked (just after Franel's paper) that the statement \sum_^ , d_, = O (n^r) \quad \forall r > \frac is also equivalent to the Riemann hypothesis.


Other sums involving Farey fractions

The sum of all Farey fractions of order is half the number of elements: \sum_ r = \frac , F_n, . The sum of the denominators in the Farey sequence is twice the sum of the numerators and relates to Euler's totient function: \sum_ b = 2 \sum_ a = 1 + \sum_^ i\varphi(i) , which was conjectured by Harold L. Aaron in 1962 and demonstrated by Jean A. Blake in 1966. A one line proof of the Harold L. Aaron conjecture is as follows. The sum of the numerators is 1 + \sum_ \ \sum_ a = 1 + \sum_ b\frac. The sum of denominators is 2 + \sum_ \ \sum_ b = 2 + \sum_ b\varphi(b). The quotient of the first sum by the second sum is . Let be the ordered denominators of , then: \sum_^ \frac = \frac and \sum_^ \frac = 1. Let \tfrac the th Farey fraction in , then \sum_^ (a_b_ - a_b_) = \sum_^ \begin a_ & a_ \\ b_ & b_ \end = 3(, F_n, -1) - 2n - 1, which is demonstrated in. Also according to this reference the term inside the sum can be expressed in many different ways: a_ b_ - a_ b_ = \frac = \frac = \left\lfloor\frac \right\rfloor, obtaining thus many different sums over the Farey elements with same result. Using the symmetry around 1/2 the former sum can be limited to half of the sequence as \sum_^ (a_ b_ - a_ b_) = \frac - n - \left\lceil \frac \right\rceil , The Mertens function can be expressed as a sum over Farey fractions as M(n)= -1+ \sum_ e^ where \mathcal_n is the Farey sequence of order . This formula is used in the proof of the Franel–Landau theorem.


Next term

A surprisingly simple algorithm exists to generate the terms of ''Fn'' 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 and are the two given entries, and is the unknown next entry, then . Since is in lowest terms, there must be an integer ''k'' such that and , giving and . If we consider ''p'' and ''q'' to be functions of ''k'', then : \frac- \frac = \frac so the larger ''k'' gets, the closer gets to . To give the next term in the sequence ''k'' must be as large as possible, subject to (as we are only considering numbers with denominators not greater than ''n''), so ''k'' is the greatest . Putting this value of ''k'' back into the equations for ''p'' and ''q'' gives : p = \left\lfloor\frac\right\rfloor c - a : q = \left\lfloor\frac\right\rfloor d - b This is implemented in Python as follows: from fractions import Fraction from collections.abc import Generator def farey_sequence(n: int, descending: bool = False) -> Generator raction """ Print the n'th Farey sequence. Allow for either ascending or descending. >>> print(*farey_sequence(5), sep=' ') 0 1/5 1/4 1/3 2/5 1/2 3/5 2/3 3/4 4/5 1 """ a, b, c, d = 0, 1, 1, n if descending: a, c = 1, n - 1 yield Fraction(a, b) while 0 <= c <= n: k = (n + b) // d a, b, c, d = c, d, k * c - a, k * d - b yield Fraction(a, b) if __name__

"__main__": import doctest doctest.testmod()
Brute-force searches for solutions to
Diophantine equation ''Diophantine'' means pertaining to the ancient Greek mathematician Diophantus. A number of concepts bear this name: *Diophantine approximation In number theory, the study of Diophantine approximation deals with the approximation of real n ...
s in rationals can often take advantage of the Farey series (to search only reduced forms). While this code uses the first two terms of the sequence to initialize ''a'', ''b'', ''c'', and ''d'', one could substitute any pair of adjacent terms in order to exclude those less than (or greater than) a particular threshold.


See also

* ABACABA pattern *
Stern–Brocot tree In number theory, the Stern–Brocot tree is an infinite complete binary tree in which the vertices correspond one-for-one to the positive rational numbers, whose values are ordered from the left to the right as in a binary search tree. The ...
*
Euler's totient function In number theory, Euler's totient function counts the positive integers up to a given integer that are relatively prime to . It is written using the Greek letter phi as \varphi(n) or \phi(n), and may also be called Euler's phi function. In ot ...


Footnotes


References


Further reading

* * — in particular, see §4.5 (pp. 115–123), Bonus Problem 4.61 (pp. 150, 523–524), §4.9 (pp. 133–139), §9.3, Problem 9.3.6 (pp. 462–463). * — reviews the isomorphisms of the Stern-Brocot Tree. * — reviews connections between Farey Fractions and Fractals. * *
Errata + Code


External links

* Online copy of book * * * * * * * * * Archived a
Ghostarchive
and th
Wayback Machine
{{Authority control Fractions (mathematics) Number theory Sequences and series