FareySequence

FareySequence[n]

generates the Farey sequence of order n.

FareySequence[n,k]

gives the k^(th) element of the Farey sequence of order n.

Details

  • The Farey sequence of order n is the sorted sequence of completely reduced fractions between 0 and 1 with denominators not exceeding n.

Examples

open allclose all

Basic Examples  (1)

Generate the Farey sequence of order 5:

Find the 17^(th) element of the Farey sequence of order 24:

Applications  (4)

Farey arc diagram, connecting adjacent rationals in a Farey sequence:

Show them together:

Visualize a pattern of denominators of a Farey sequence of order 12:

The length of a Farey sequence of few small orders:

Compare to a closed-form formula in terms of Euler's totient function:

Construct Ford circles from a Farey sequence:

Properties & Relations  (2)

Obtain a Farey sequence as a union of Subdivide lists:

FareySequence[n,k] is equivalent to FareySequence[n]k:

FareySequence[n,k] is much faster:

Wolfram Research (2014), FareySequence, Wolfram Language function, https://reference.wolfram.com/language/ref/FareySequence.html (updated 2016).

Text

Wolfram Research (2014), FareySequence, Wolfram Language function, https://reference.wolfram.com/language/ref/FareySequence.html (updated 2016).

BibTeX

@misc{reference.wolfram_2021_fareysequence, author="Wolfram Research", title="{FareySequence}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/FareySequence.html}", note=[Accessed: 03-August-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_fareysequence, organization={Wolfram Research}, title={FareySequence}, year={2016}, url={https://reference.wolfram.com/language/ref/FareySequence.html}, note=[Accessed: 03-August-2021 ]}

CMS

Wolfram Language. 2014. "FareySequence." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/FareySequence.html.

APA

Wolfram Language. (2014). FareySequence. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FareySequence.html