Skip to main content
Calculator Fractions

Farey Sequence Calculator

Generate ordered reduced fractions.

Sequences & Series

Use the Farey Sequence Calculator

Result
—

How Farey Sequence Calculator Works?

The Farey Sequence Calculator works in 4 steps: it reads a list of fractions, converts each fraction to a decimal value, sorts the list from smallest to largest, and returns the ordered sequence joined by less-than signs. Entering every reduced fraction with a denominator up to n produces the Farey sequence of order n.

  1. List the fractions for order n

    Write every reduced fraction from 0/1 to 1/1 with a denominator of n or less. For n = 6, the list has 13 fractions.

  2. Enter the fractions

    Type the fractions in any order, separated by commas, for example 1/2, 5/6, 0/1, 1/6, 2/3, 1/5, 3/5, 1/1, 1/4, 2/5, 4/5, 3/4, 1/3.

  3. Sort by value

    The calculator compares the decimal value of each fraction and orders the list from the smallest value to the largest value.

  4. Read the ordered sequence

    The calculator returns 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, which is the Farey sequence F6.

Farey Sequence Calculator Formula

The Farey sequence formula is Fn = all reduced fractions h/k with 0 ≤ h ≤ k ≤ n, in increasing order. Neighbors a/b and c/d in Fn satisfy b·c - a·d = 1.

Neighbor property

b·c - a·d = 1

a/b and c/d are consecutive terms in Fn. 2/5 and 1/2 are neighbors in F5: 5·1 - 2·2 = 1.

Mediant rule

(a + c)/(b + d)

The first fraction that appears between neighbors a/b and c/d is the mediant. It enters the sequence at order n = b + d.

Length of Fn

|Fn| = |F(n-1)| + φ(n), |F1| = 2

φ(n) is the Euler totient function: the count of numbers from 1 to n that share no factor other than 1 with n. Each order adds φ(n) new fractions.

Smallest gap

min gap in Fn = 1/(n·(n - 1)), n ≥ 2

The closest pair in Fn is 1/n and 1/(n - 1).

Worked example: build F7 from F6

  1. Start with F6, which has 13 terms.
  2. Find φ(7): 7 is prime, so all 6 numbers from 1 to 6 are coprime to 7, and φ(7) = 6.
  3. Insert each mediant with denominator 7: 1/7 between 0/1 and 1/6, 2/7 between 1/4 and 1/3, and 3/7 between 2/5 and 1/2.
  4. Insert the mirror terms 4/7, 5/7, and 6/7 between 1/2 and 3/5, 2/3 and 3/4, and 5/6 and 1/1.
  5. Count: 13 + 6 = 19 terms in F7.

Farey Sequence Calculator Conversion Table

The Farey sequence conversion table lists 12 orders with the number of terms, the new fractions added at that order, and the smallest gap.

Order nNumber of TermsSequence or New TermsSmallest Gap
120/1, 1/11
230/1, 1/2, 1/11/2
350/1, 1/3, 1/2, 2/3, 1/11/6
470/1, 1/4, 1/3, 1/2, 2/3, 3/4, 1/11/12
5110/1, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1/11/20
613adds 1/6, 5/61/30
719adds 1/7, 2/7, 3/7, 4/7, 5/7, 6/71/42
823adds 1/8, 3/8, 5/8, 7/81/56
929adds 1/9, 2/9, 4/9, 5/9, 7/9, 8/91/72
1033adds 1/10, 3/10, 7/10, 9/101/90
1143adds 1/11 to 10/11 (10 terms)1/110
1247adds 1/12, 5/12, 7/12, 11/121/132

What is Farey Sequence Calculator?

A Farey Sequence Calculator is a tool that orders reduced fractions between 0 and 1 from smallest to largest, producing the Farey sequence Fn for a chosen order n. The order n is the largest denominator allowed.

The Farey sequence is named after John Farey, a British geologist who described the mediant property in 1816. Each new order keeps every earlier term and inserts new fractions with denominator n. The sequence is symmetric: for every term h/k, the term (k - h)/k appears in the same sequence.

Farey sequences have 3 defining properties. Neighbors a/b and c/d satisfy b·c - a·d = 1. The first new fraction between 2 neighbors is the mediant (a + c)/(b + d). The length grows by φ(n) at each order, so F12 has 47 terms and F100 has 3045 terms.

What are the uses of Farey Sequence Calculator?

The Farey Sequence Calculator has 5 main uses, including fraction ordering practice, best-approximation search, and number theory study.

  • Ordering fractions

    Students sort fractions with different denominators and see where 3/7 or 5/8 falls relative to familiar values such as 1/2.

  • Finding best approximations

    Analysts locate the 2 Farey neighbors that bracket a decimal and pick the closer one as the best fraction with a denominator limit.

  • Studying number theory

    Students connect Farey sequences to the Euler totient function, Ford circles, and the Stern-Brocot tree.

  • Building fraction number lines

    Teachers draw number lines with every fraction up to denominator 8 and use the 23 points of F8 as tick marks.

  • Testing sorting code

    Programmers check fraction comparison functions against the known order and length of each Fn.

Related Sequences & Series Tools

View all 270 tools →