Farey Sequence Generator

All fractions with denominator ≤ n

CalculatorsFreeNo Signup
4.3(676 reviews)
All Tools

Loading tool...

About Farey Sequence Generator

A Farey sequence generator listing all reduced fractions p/q where 0 ≤ p/q ≤ 1 and q ≤ n. Shows mediant property, count |F(n)|, connections to Euler's totient, and the Stern-Brocot tree. Client-side.

Farey Sequence Generator Features

  • Fraction list
  • Mediant
  • Count
  • Totient link
  • Neighbors
Farey sequence F(n): all reduced fractions 0/1 ≤ p/q ≤ 1/1 with q ≤ n, in ascending order. F(5) = 0/1, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1/1. |F(n)| = 1 + Σφ(k) for k=1..n. Mediant property: if a/b, c/d are neighbors, (a+c)/(b+d) appears in F(b+d).

How to Use

Enter order n:

  • F(n): All fractions
  • Count: |F(n)|
  • Neighbors: Mediant property

Mediant Property

For consecutive fractions a/b, c/d in F(n): |bc−ad|=1 (determinant). The mediant (a+c)/(b+d) appears in F(b+d). This is how fractions 'insert' as n increases.

Applications

  • Best rational approximations
  • Ford circles (tangent circles)
  • Riemann hypothesis connection
  • Number theory proofs

Step-by-Step Instructions

  1. 1Enter order n.
  2. 2View F(n).
  3. 3Count fractions.
  4. 4Check mediants.
  5. 5Explore neighbors.

Farey Sequence Generator — Frequently Asked Questions

How many fractions are in F(n)?+

|F(n)| = 1 + Σφ(k) for k=1 to n. Approximately 3n²/π². F(5)=11, F(10)=33, F(100)=3045, F(1000)=304,193. Each new order n adds φ(n) new fractions.

What is the mediant property?+

If a/b and c/d are Farey neighbors (consecutive in some F(n)): their mediant (a+c)/(b+d) is the fraction that 'splits' them when the order increases to n=b+d. Also |bc−ad|=1, a beautiful determinant condition.

Connection to Ford circles?+

Each fraction p/q has a Ford circle: center (p/q, 1/(2q²)), radius 1/(2q²). Farey neighbors have tangent Ford circles. This gives a beautiful geometric visualization of the Farey sequence.

Share this tool: