Library/Algebra/Sequences/Farey sequence

Farey sequence

Overview
Important

The Farey sequence of order nn, denoted FnF_n, is the ascending sequence of completely reduced fractions between 00 and 11 whose denominators do not exceed nn. Each fraction a/ba/b in FnF_n satisfies 0leqaleqbleqn0 \\leq a \\leq b \\leq n and gcd(a,b)=1\gcd(a, b) = 1.

Important properties

  • Each Farey sequence starts with 0/10/1 and ends with 1/11/1.

  • No two consecutive fractions in a Farey sequence are equal.

  • If a/ba/b and c/dc/d are consecutive terms in FnF_n, then bcad=1bc - ad = 1.

  • Every Farey sequence FnF_n contains all the terms of Fn1F_{n-1}, plus possibly some new fractions.