Farey fractions from 0 to 1: what this calculator generates
A Farey sequence is a particularly orderly way to arrange simple fractions. For a chosen order n, the Farey sequence Fn contains every reduced fraction from 0 to 1 whose denominator is no greater than n, written in increasing order. The result makes the structure of rational numbers visible: it shows which fractions qualify under a denominator limit, how they fill the unit interval, and how neighboring terms are connected.
This Farey Sequence Calculator avoids the tedious part of making that list by hand. Beyond small orders, it is easy to omit an eligible fraction, retain an equivalent form such as 2/4, or misorder close values. Entering the order produces the complete ordered sequence and its length, leaving you free to examine the number-theory pattern rather than sort fractions manually.
Farey sequences are useful in fraction lessons, elementary number theory, and rational-approximation work. They provide a complete catalogue of reduced fractions under a specified denominator cap. This page both generates that catalogue and explains the role of the order, the rule for adjacent terms, and the meaning of the displayed length.
The denominator-limit problem answered by Fn
This Farey sequence calculator enumerates all distinct reduced fractions between 0 and 1 whose denominators are at most n, then places them in strict numerical order. Put another way, it answers: “Which rational values in the unit interval can be represented with denominators no larger than this limit?”
The order is a denominator ceiling, not a count of entries. Equivalent fractions do not receive separate places: 2/4 is absent because it is the same number as the reduced fraction 1/2. The fractions are ordered by value rather than evenly spaced as decimals, so the visible gaps vary according to the reduced fractions available at the selected order.
For rational approximation, the list lets you inspect the simple fractions surrounding a decimal between 0 and 1. Rather than build and compare candidate fractions one at a time, you can generate the entire eligible set and examine the relevant neighboring terms.
Generating an ordered Farey sequence on this page
This Farey sequence calculator requires one main input. Enter a positive integer order n, select Generate, and the result area displays Fn as a comma-separated sequence. It also reports the number of terms, which can be checked against the expected sequence length.
Start with a small Farey order such as 4, 5, or 6 when learning the pattern. Those sequences are short enough to inspect directly, while still showing how new reduced fractions appear. Increasing n adds allowable denominators and makes the list denser. The copy button can then transfer the generated sequence to notes, homework, or a spreadsheet without retyping it.
- Enter a positive integer for Farey Order (n).
- Click Generate to build the sequence.
- Read the length, then inspect the terms from 0/1 through 1/1.
- Use Copy Sequence to save or share the displayed result.
If the page says the order must be a positive integer, the value is either not whole or is below 1. If it says the order is too large to display comfortably, choose a smaller order. That display limit keeps the resulting Farey list readable and responsive.
Choosing the order n for a Farey list
The Farey order n is the calculator’s only mathematical input, and it sets the largest usable denominator. With n = 8, for example, 3/7 is eligible but 4/9 is not. Eligible fractions must also be in lowest terms, so 3/6 is excluded; its value is already represented by 1/2.
Raising n lengthens the Farey sequence because additional denominators become available. New reduced fractions are inserted between terms already present, so the unit interval becomes more finely divided. The growth is not uniform: a denominator contributes only as many new fractions as it has numerators relatively prime to it.
Select a small order for a compact teaching example and a larger one for a denser reference list. Since the number of terms rises quickly, a high denominator ceiling can make the visible sequence long even though the membership rule remains simple.
Farey sequence rules, length, and next-term recurrence
A fraction a/b is a member of Fn when it is between 0 and 1, is reduced, and has b no larger than n. Consecutive Farey fractions have a special determinant relation. If a/b and c/d are neighbors, their cross-products differ by one.
This identity characterizes how closely adjacent Farey terms fit together under the denominator bound. The number of terms has a compact expression using Euler’s totient function, which counts the positive numerators less than a denominator that are relatively prime to it.
For n = 5, this gives 1 + φ(1) + φ(2) + φ(3) + φ(4) + φ(5) = 1 + 1 + 1 + 2 + 2 + 4 = 11 terms. The calculator generates terms directly with the standard recurrence for consecutive Farey fractions rather than testing and sorting every possible numerator and denominator pair.
Here, the recurrence begins with 0/1 and 1/n. At each step it uses the current neighboring terms to calculate the next numerator p and denominator q. The resulting output is the increasing Farey sequence itself, not a generic aggregate or weighted total.
Worked Farey construction for F5
This Farey example uses order 5 because it is detailed enough to reveal the pattern while remaining easy to inspect. The allowed denominators are 1, 2, 3, 4, and 5. Fractions must be between 0 and 1 and in lowest terms, so 2/4 is omitted because 1/2 already represents that value.
The complete sequence is:
F5 = 0/1, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1/1
Every term increases from left to right, and no qualifying reduced fraction is missing. The smallest positive term is 1/5, while 1/2 sits at the middle of this 11-term list. Reduced fifths such as 2/5 and 3/5 appear, whereas 2/4 does not. The totient length calculation above also gives 11, agreeing with the generated list.
The adjacent-term rule can be checked directly. For 1/3 and 2/5, taking a/b = 1/3 and c/d = 2/5 gives bc - ad = 3·2 - 1·5 = 1. For 2/5 and 1/2, the calculation is 5·1 - 2·2 = 1. When the calculator runs at n = 5, it should return this same ordered sequence.
How Farey sequences expand from order 4 through 7
This Farey growth table shows that increasing the order by one does not always add the same number of fractions. It highlights which reduced fractions are introduced by each new denominator and why the sequence can become dense quickly.
Growth of Farey sequences for small orders
| Order n |
Length |Fn| |
New reduced fractions compared with the previous order |
Interpretation |
| 4 |
7 |
— (baseline sequence) |
A short teaching example with clearly spaced terms. |
| 5 |
11 |
1/5, 2/5, 3/5, 4/5 |
Order 5 inserts four new reduced fifths between existing neighbors. |
| 6 |
13 |
1/6, 5/6 |
Only two sixths are new because 2/6, 3/6, and 4/6 reduce to earlier terms. |
| 7 |
19 |
1/7, 2/7, 3/7, 4/7, 5/7, 6/7 |
Prime denominators often contribute many new fractions because more numerators are coprime to the denominator. |
The changing contribution at each order comes from the number of numerators relatively prime to the new denominator. That is precisely the quantity counted by Euler’s totient function in the Farey-length formula.
Reading the generated Farey terms and length
This Farey calculator returns a numerical ordering, not an unordered collection of fractions. Its left endpoint is always 0/1 and its right endpoint is always 1/1. Every term between them is reduced. When an expected fraction is absent, either its denominator exceeds the chosen order or it simplifies to a fraction already in the sequence.
The displayed length is a quick completeness check before you inspect every entry. The list is especially useful for studying adjacent fractions, locating simple approximations to decimals in the unit interval, and comparing the terms created when the denominator limit rises. The copy button supports those follow-up uses by preserving the generated ordering.
This calculator covers only the interval from 0 to 1, as classical Farey sequences do. To use the list with a value greater than 1, separate the integer part and compare its fractional part to the Farey terms.
Practical limits of the Farey sequence generator
This Farey sequence generator lists its qualifying fractions exactly, but a browser page has practical limits on how much output is pleasant to read. Larger orders create many more terms, and an enormous sequence is difficult to inspect even when every fraction is mathematically valid.
The tool generates the classical Farey sequence on [0, 1]. It does not build a Stern-Brocot tree, calculate a continued-fraction approximation for an arbitrary real number, or list unreduced equivalents. Those related number-theory tasks use different constructions.
- Interval scope: the sequence covers fractions from 0/1 through 1/1 only.
- Reduced terms only: equivalent forms such as 2/4 are intentionally omitted.
- Integer input required: the order must be a positive whole number.
- Long-output practicality: very large orders create very long lists that are hard to read and copy.
- No symbolic proofs: the page computes and displays the sequence, but it does not prove number-theory theorems for you.
Within those bounds, the calculator provides the exact increasing Farey list for the selected denominator limit. It offers a clearer view of reduced-fraction structure than an unsorted collection of decimal approximations.