Farey sequence
Script error: No such module "Multiple image". In mathematics, the Farey sequence of order n is the sequence of completely reduced fractions, either between 0 and 1, or without this restriction,Template:Efn which have denominators 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 Template:Sfrac, and ends with the value 1, denoted by the fraction Template:Sfrac (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.[1]
Examples
The Farey sequences of orders 1 to 8 are :
- F1 = { Template:Sfrac, Template:Sfrac }
- F2 = { Template:Sfrac, Template:Sfrac, Template:Sfrac }
- F3 = { Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac }
- F4 = { Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac }
- F5 = { Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac }
- F6 = { Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac }
- F7 = { Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac }
- F8 = { Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac }
| Sorted |
|---|
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}
|
Farey sunburst
Plotting the numerators versus the denominators of a Farey sequence gives a shape like the one to the right, shown for Template:Var6.Script error: No such module "Check for unknown parameters".
Reflecting this shape around the diagonal and main axes generates the Farey sunburst, shown below. The Farey sunburst of order Template:Mvar connects the visible integer grid points from the origin in the square of side 2Template:VarScript error: No such module "Check for unknown parameters"., centered at the origin. Using Pick's theorem, the area of the sunburst is 4(Template:Abs − 1)Script error: No such module "Check for unknown parameters"., where Template:AbsScript error: No such module "Check for unknown parameters". is the [[#Sequence_length_and_index_of_a_fraction|number of fractions in Template:VarTemplate:VarScript error: No such module "Check for unknown parameters".]].
History
- The history of 'Farey series' is very curious — Hardy & Wright (1979)[2]
- ... 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)[3]
Farey sequences are named after the British geologist John Farey, Sr., whose letter about these sequences was published in the Philosophical Magazine in 1816.[4] 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 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.[3] 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 Template:Mvar contains all of the members of the Farey sequences of lower orders. In particular Template:Mvar contains all of the members of Fn−1Script error: No such module "Check for unknown parameters". and also contains an additional fraction for each number that is less than Template:Mvar and coprime to Template:Mvar. Thus F6Script error: No such module "Check for unknown parameters". consists of F5Script error: No such module "Check for unknown parameters". together with the fractions Template:Sfrac and Template:Sfrac.
The middle term of a Farey sequence Template:Mvar is always Template:Sfrac, for n > 1Script error: No such module "Check for unknown parameters".. From this, we can relate the lengths of Template:Mvar and Fn−1Script error: No such module "Check for unknown parameters". using Euler's totient function φ(n)Script error: No such module "Check for unknown parameters".:
Using the fact that Template:Abs = 2Script error: No such module "Check for unknown parameters"., we can derive an expression for the length of Template:Mvar:[5]
where Φ(n)Script error: No such module "Check for unknown parameters". is the summatory totient.
We also have : and by a Möbius inversion formula : where μ(d)Script error: No such module "Check for unknown parameters". is the number-theoretic Möbius function, and is the floor function.
The asymptotic behaviour of Template:AbsScript error: No such module "Check for unknown parameters". is :
The number of Farey fractions with denominators equal to Template:Mvar in Template:Mvar is given by φ(k)Script error: No such module "Check for unknown parameters". when k ≤ nScript error: No such module "Check for unknown parameters". and zero otherwise. Concerning the numerators one can define the function that returns the number of Farey fractions with numerators equal to Template:Mvar in Template:Mvar. This function has some interesting properties as[6]
- ,
- for any prime number ,
- for any integer m ≥ 0Script error: No such module "Check for unknown parameters".,
In particular, the property in the third line above implies and, further, The latter means that, for Farey sequences of even order Template:Mvar, the number of fractions with numerators equal to Template:SfracScript error: No such module "Check for unknown parameters". is the same as the number of fractions with denominators equal to Template:SfracScript error: No such module "Check for unknown parameters"., that is .
The index of a fraction in the Farey sequence is simply the position that occupies in the sequence. This is of special relevance as it is used in an alternative formulation of the Riemann hypothesis, see below. Various useful properties follow:
The index of Template:SfracScript error: No such module "Check for unknown parameters". where Template:Sfrac < k ≤ Template:SfracScript error: No such module "Check for unknown parameters". and Template:Mvar is the least common multiple of the first Template:Mvar numbers, n = lcm([2, i])Script error: No such module "Check for unknown parameters"., is given by:[7]
A similar expression was used as an approximation of for low values of in the classical paper by F. Dress.[8] A general expression for for any Farey fraction is given in.[9]
Farey neighbours
Fractions which are neighbouring terms in any Farey sequence are known as a Farey pair and have the following properties.
If Template:SfracScript error: No such module "Check for unknown parameters". and Template:SfracScript error: No such module "Check for unknown parameters". are neighbours in a Farey sequence, with Template:Sfrac < Template:SfracScript error: No such module "Check for unknown parameters"., then their difference Template:Sfrac − Template:SfracScript error: No such module "Check for unknown parameters". is equal to Template:SfracScript error: No such module "Check for unknown parameters".. Since
this is equivalent to saying that
Thus Template:Sfrac and Template:Sfrac are neighbours in F5Script error: No such module "Check for unknown parameters"., and their difference is Template:Sfrac.
The converse is also true. If
for positive integers a, b, c, dScript error: No such module "Check for unknown parameters". with a < bScript error: No such module "Check for unknown parameters". and c < dScript error: No such module "Check for unknown parameters"., then Template:SfracScript error: No such module "Check for unknown parameters". and Template:SfracScript error: No such module "Check for unknown parameters". will be neighbours in the Farey sequence of order max(b,d)Script error: No such module "Check for unknown parameters"..
If Template:SfracScript error: No such module "Check for unknown parameters". has neighbours Template:SfracScript error: No such module "Check for unknown parameters". and Template:SfracScript error: No such module "Check for unknown parameters". in some Farey sequence, with Template:Sfrac < Template:Sfrac < Template:SfracScript error: No such module "Check for unknown parameters"., then Template:SfracScript error: No such module "Check for unknown parameters". is the mediant of Template:SfracScript error: No such module "Check for unknown parameters". and Template:SfracScript error: No such module "Check for unknown parameters". – in other words,
This follows easily from the previous property, since if
It follows that if Template:SfracScript error: No such module "Check for unknown parameters". and Template:SfracScript error: No such module "Check for unknown parameters". are neighbours in a Farey sequence then the first term that appears between them as the order of the Farey sequence is incremented is
which first appears in the Farey sequence of order b + dScript error: No such module "Check for unknown parameters"..
Thus the first term to appear between Template:Sfrac and Template:Sfrac is Template:Sfrac, which appears in F8Script error: No such module "Check for unknown parameters"..
The total number of Farey neighbour pairs in Template:Mvar is 2Template:Abs − 3Script error: No such module "Check for unknown parameters"..
The Stern–Brocot tree is a data structure showing how the sequence is built up from 0 Template:Pars and 1 Template:Pars, by taking successive mediants. Note, however, that at the nScript error: No such module "Check for unknown parameters".th step of the construction of the Stern–Brocot tree all mediants are included, not only the ones with denominator equal to nScript error: No such module "Check for unknown parameters"..
Equivalent-area interpretation
Every consecutive pair of Farey rationals have an equivalent area of 1.[10] See this by interpreting consecutive rationals as vectors (p, q)Script error: No such module "Check for unknown parameters". in the xy-plane. The area is given by As any added fraction in between two previous consecutive Farey sequence fractions is calculated as the mediant (⊕), then (since r1 = Template:SfracScript error: No such module "Check for unknown parameters". and r2 = Template:SfracScript error: No such module "Check for unknown parameters"., its area must be 1).
Farey neighbours and continued fractions
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 by 1. If Template:SfracScript error: No such module "Check for unknown parameters"., which first appears in Farey sequence Template:Mvar, has the continued fraction expansions
then the nearest neighbour of Template:SfracScript error: No such module "Check for unknown parameters". in Template:Mvar (which will be its neighbour with the larger denominator) has a continued fraction expansion
and its other neighbour has a continued fraction expansion
For example, Template:Sfrac has the two continued fraction expansions [0; 2, 1, 1, 1]Script error: No such module "Check for unknown parameters". and [0; 2, 1, 2]Script error: No such module "Check for unknown parameters"., and its neighbours in F8Script error: No such module "Check for unknown parameters". are Template:Sfrac, which can be expanded as [0; 2, 1, 1]Script error: No such module "Check for unknown parameters".; and Template:Sfrac, which can be expanded as [0; 2, 1]Script error: No such module "Check for unknown parameters"..
Farey fractions and the least common multiple
The lcm can be expressed as the products of Farey fractions as
where ψ(N)Script error: No such module "Check for unknown parameters". is the second Chebyshev function.[11][12]
Farey fractions and the greatest common divisor
Since the Euler's totient function is directly connected to the gcd so is the number of elements in Template:Mvar,
For any 3 Farey fractions Template:Sfrac, Template:Sfrac, Template:SfracScript error: No such module "Check for unknown parameters". the following identity between the gcd's of the 2×2 matrix determinants in absolute value holds:[13][7]
Applications
Farey sequences are very useful to find rational approximations of irrational numbers.[14] For example, the construction by Eliahou[15] of a lower bound on the length of non-trivial cycles in the 3x+1 process uses Farey sequences to calculate a continued fraction expansion of the number log2(3)Script error: No such module "Check for unknown parameters"..
In physical systems with resonance phenomena, Farey sequences provide a very elegant and efficient method to compute resonance locations in 1D[16] and 2D.[17][18]
Farey sequences are prominent in studies of any-angle path planning on square-celled grids, for example in characterizing their computational complexity[19] or optimality.[20] The connection can be considered in terms of Template:Mvar-constrained paths, namely paths made up of line segments that each traverse at most Template:Mvar rows and at most Template:Mvar columns of cells. Let Template:Mvar be the set of vectors (q, p)Script error: No such module "Check for unknown parameters". such that , , and Template:Mvar, Template:Mvar are coprime. Let Template:Mvar be the result of reflecting Template:Mvar in the line y = xScript error: No such module "Check for unknown parameters".. Let . Then any Template:Mvar-constrained path can be described as a sequence of vectors from Template:Mvar. There is a bijection between Template:Mvar and the Farey sequence of order Template:Mvar given by (q, p)Script error: No such module "Check for unknown parameters". mapping to .
Ford circles
There is a connection between Farey sequence and Ford circles.
For every fraction Template:SfracScript error: No such module "Check for unknown parameters". (in its lowest terms) there is a Ford circle C[p/q]Script error: No such module "Check for unknown parameters"., which is the circle with radius and centre at Two Ford circles for different fractions are either disjoint or they are tangent to one another—two Ford circles never intersect. If 0 < Template:Sfrac < 1Script error: No such module "Check for unknown parameters". then the Ford circles that are tangent to C[p/q]Script error: No such module "Check for unknown parameters". are precisely the Ford circles for fractions that are neighbours of Template:SfracScript error: No such module "Check for unknown parameters". in some Farey sequence.
Thus C[2/5]Script error: No such module "Check for unknown parameters". is tangent to C[1/2]Script error: No such module "Check for unknown parameters"., C[1/3]Script error: No such module "Check for unknown parameters"., C[3/7]Script error: No such module "Check for unknown parameters"., C[3/8]Script error: No such module "Check for unknown parameters"., etc.
Ford circles appear also in the Apollonian gasket (0,0,1,1)Script error: No such module "Check for unknown parameters".. The picture below illustrates this together with Farey resonance lines.[21]
Riemann hypothesis
Farey sequences are used in two equivalent formulations of the Riemann hypothesis. Suppose the terms of Template:Mvar are Define in other words is the difference between the Template:Mvarth term of the Template:Mvarth Farey sequence, and the Template:Mvarth member of a set of the same number of points, distributed evenly on the unit interval. In 1924 Jérôme Franel[22] proved that the statement
is equivalent to the Riemann hypothesis, and then Edmund Landau[23] remarked (just after Franel's paper) that the statement
is also equivalent to the Riemann hypothesis.
Other sums involving Farey fractions
The sum of all Farey fractions of order Template:Mvar is half the number of elements:
The sum of the denominators in the Farey sequence is twice the sum of the numerators and relates to Euler's totient function:
which was conjectured by Harold L. Aaron in 1962 and demonstrated by Jean A. Blake in 1966.[24] A one line proof of the Harold L. Aaron conjecture is as follows. The sum of the numerators is The sum of denominators is The quotient of the first sum by the second sum is Template:Sfrac.
Let Template:Mvar be the ordered denominators of Template:Mvar, then:[25]
and
Let the Template:Mvarth Farey fraction in Template:Mvar, then
which is demonstrated in.[26] Also according to this reference the term inside the sum can be expressed in many different ways:
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
The Mertens function can be expressed as a sum over Farey fractions as where is the Farey sequence of order Template:Mvar.
This formula is used in the proof of the Franel–Landau theorem.[27]
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 Template:Sfrac and Template:Sfrac are the two given entries, and Template:Sfrac is the unknown next entry, then Template:Sfrac = Template:SfracScript error: No such module "Check for unknown parameters".. Since Template:Sfrac is in lowest terms, there must be an integer k such that kc = a + pScript error: No such module "Check for unknown parameters". and kd = b + qScript error: No such module "Check for unknown parameters"., giving p = kc − aScript error: No such module "Check for unknown parameters". and q = kd − bScript error: No such module "Check for unknown parameters".. If we consider p and q to be functions of k, then
so the larger k gets, the closer Template:Sfrac gets to Template:Sfrac.
To give the next term in the sequence k must be as large as possible, subject to kd − b ≤ nScript error: No such module "Check for unknown parameters". (as we are only considering numbers with denominators not greater than n), so k is the greatest integer ≤ Template:Sfrac. Putting this value of k back into the equations for p and q gives
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[Fraction]:
"""
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)
Brute-force searches for solutions to Diophantine equations 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.[28]
See also
Footnotes
References
<templatestyles src="Reflist/styles.css" />
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ a b Script error: No such module "citation/CS1". Cited in Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".Script error: No such module "Check for unknown parameters".
- ↑ Script error: No such module "Citation/CS1".
- ↑ a b Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
Script error: No such module "Check for unknown parameters".
Further reading
- Script error: No such module "citation/CS1".
- Script error: No such module "citation/CS1". — 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).
- Script error: No such module "citation/CS1". — reviews the isomorphisms of the Stern-Brocot Tree.
- Script error: No such module "citation/CS1". — reviews connections between Farey Fractions and Fractals.
- Script error: No such module "Citation/CS1". Script error: No such module "citation/CS1". Script error: No such module "citation/CS1".
- Script error: No such module "citation/CS1". Errata + CodeTemplate:Cbignore
External links
- Script error: No such module "citation/CS1". Online copy of book
- Script error: No such module "citation/CS1".
- Script error: No such module "citation/CS1".
- Script error: No such module "citation/CS1".
- Template:Springer
- Script error: No such module "Template wrapper".
- Template:OEIS el
- Template:OEIS el
- Template:OEIS el
- Archived at GhostarchiveTemplate:Cbignore and the Wayback MachineTemplate:Cbignore: Script error: No such module "Citation/CS1".Template:Cbignore