Farey Sequence Calculator

Farey Sequence Preview

Understanding Farey Sequences

What is a Farey Sequence?

A Farey sequence of order n is the sequence of completely reduced fractions between 0 and 1 which, when in lowest terms, have denominators less than or equal to n, arranged in order of increasing size.

Formula

There's no simple formula to generate a Farey sequence, but we can describe the process:

  1. Start with the fractions 0/1 and 1/1.
  2. For each number d from 1 to n:
    • For each number k from 1 to d-1:
    • If k and d are coprime (their greatest common divisor is 1), add the fraction k/d to the sequence.
  3. Sort the sequence in ascending order.

Calculation Steps

Let's calculate the Farey sequence of order 4:

  1. Start with 0/1 and 1/1
  2. For d = 1, no new fractions
  3. For d = 2, add 1/2
  4. For d = 3, add 1/3 and 2/3
  5. For d = 4, add 1/4 and 3/4 (2/4 is not in lowest terms)
  6. Sort the sequence

Result: 0/1, 1/4, 1/3, 1/2, 2/3, 3/4, 1/1

Example and Visual Representation

0/1 1/4 1/3 1/2 2/3 3/4 1/1

This diagram illustrates the Farey sequence of order 4 on a unit circle. Each fraction is represented by a point on the circle, with the angle from the positive x-axis proportional to the value of the fraction.