Farey Sequences Definition A Farey sequence F (n) is a complete sequence of reduced form rational fractions in 0 a a p 1 with b j n for j . The the range 0..1 of the form F (n) 0 ..... b p 1 1 b0 sequence is complete in the sense that, given a Farey sequence as defined above, we aj p a j 1 p can find no rational fraction with q n such that . b j q b j 1 q Theorem Given a Farey sequence F (n) , the following equality holds for 0 j p : a j 1 a j 1 b j 1 b j 1 aj bj where a1 0 , a p 1 1 , b1 1 , b p 1 1 . Proof Proof is by induction. For n 2 , we have the trivial Farey sequence 0 1 1 F (2) , , where the above equality holds for j 0 . Given a Farey sequence 1 2 1 F (n) , the sequence F (n 1) comprises a merge of F (n) and the sequence kp k k ki F ' (n 1) 0 , 1 ..... n 1 , 0 k i n 1 : i . If some F ' (n 1) is not n 1 n 1 n 1 n 1 k' in reduced form then it can be represented as a reduced form rational fraction with n' k ' n' n . But this fraction will already be a member of F (n) since F (n) is complete. Thus only reduced form fractions will be members of F ' (n 1) and will be merged with F (n) . The merge is such that all elements of F ' (n 1) are inserted in their correct position in the sequence F (n) in order to produce F (n 1) . (This observation enables an algorithm for the construction of F (n) for any n to be designed.) The complete proof will use the following 4 lemmas. Lemma 1 There exists integers a , b , k and n such that k a k 1 for n 2, 0 k n 1, a b n b n Proof Choose a k , b n 1 . It is easy to verify that k k k 1 . n n 1 n Lemma 2 After merging, no two consecutive members of F ' (n 1) will be consecutive aj members of F (n 1) . Thus we can always find some fraction such that bj aj ki k i 1 and where a j b j n . n 1 bj n 1 Proof This follows directly from Lemma 1 since k i 1 k i 1 . Lemma 3 Given a Farey sequence 0 a a p 1 F (n) 0 ..... , for any 1 j p , b p 1 1 b0 a j 1b j b j 1 a j 1 . Proof This follows directly from the theorem a j 1 a j 1 b j 1 b j 1 aj bj a j 1 a j 1 b j 1 b j 1 aj bj . a j b j 1 a j b j 1 a j 1b j a j 1b j a j b j 1 a j 1b j a j 1b j a j b j 1 This applies for all 0 j p and can be applied successively to create a sequence a0b1 a1b0 a1b0 a0 b1 ......a j 1b j a j b j 1 .......a p1b p a p b p1 . a1 0, a0 1, b1 1, b0 n a0 b1 a1b0 1 and hence a j 1b j a j b j 1 1 for 1 j p . But aj a j 1 k ki i are F ' (n 1) such that b j n 1 b j 1 n 1 aj a j 1 consecutive members of F (n 1) and where and are consecutive members bj b j 1 From Lemma 2 we have some of F (n) and ki is in reduced form. n 1 Consider the rational fractions k i a j 1 , ki a j n 1 b j 1 n 1 b j . We can prove the following lemma. Lemma 4 k i a j 1 n 1 b j 1 aj bj , ki a j n 1 bj a j 1 b j 1 Proof a j 1 b j 1 k i a j 1 ki k k i b j 1 a j 1 (n 1) k i (n 1) a j 1 (n 1) k i (n 1) k i b j 1 i n 1 n 1 n 1 b j 1 Assume k i a j 1 n 1 b j 1 k i a j 1 n 1 b j 1 aj bj aj bj k i b j a j 1b j a j (n 1) a j b j 1 k i b j a j (n 1) a j 1b j a j b j 1 k i b j a j (n 1) 1 which follows from Lemma 3. But Since k i b j a j (n 1) k i a j 1 n 1 b j 1 aj bj rational fraction . Since aj ki k i b j a j (n 1) 0 n 1 bj is an integer, our original assumption is false and k i a j 1 n 1 b j 1 F ( n) , k i a j 1 n 1 b j 1 aj bj because there is no aj k p p i as F (n) is complete. F (n) such that bj q n 1 q The second equality can be proved using a similar technique aj bj ki a j ki k k i b j a j (n 1) k i (n 1) k i b j k i (n 1) a j (n 1) i n 1 n 1 n 1 bj Assume ki a j n 1 bj ki a j n 1 bj a j 1 b j 1 a j 1 b j 1 k i b j 1 a j b j 1 a j 1 (n 1) a j 1b j a j 1b j a j b j 1 a j 1 (n 1) k i b j 1 a j 1 (n 1) k i b j 1 1 a j 1 ki a j 1 (n 1) k i b j 1 0 n 1 b j 1 which follows from Lemma 3. But Since a j 1 (n 1) k i b j 1 is an integer, our original assumption is false and ki a j n 1 bj a j 1 b j 1 rational fraction . Since ki a j n 1 bj F ( n) , ki a j n 1 bj a j 1 b j 1 because there is no k p a j 1 p as F (n) is complete. F (n) such that i n 1 q b j 1 q This proves Lemma 4. From Lemmas 3 and 4, the proof of the theorem follows directly. ki a j n 1 bj k i a j 1 n 1 b j 1 a j 1 b j 1 aj bj k i b j 1 a j b j 1 a j 1 (n 1) b j a j 1 a j 1 (n 1) k i b j 1 1 k i b j a j 1b j a j (n 1) a j b j 1 k i b j a j (n 1) 1 k i b j a j (n 1) a j 1 (n 1) k i b j 1 a j a j 1 ki n 1 b j b j 1 ki inserted into F (n) obeys the equality n 1 given in the Theorem. However, we still have to consider preceding values to check whether the Theorem is generally applicable to F (n 1) . This shows that the rational fraction There are 2 possibilities: where a j 1 b j 1 aj bj a j 1 a j 1 aj a j 1 ki k k i 1 i and n 1 b j 1 b j 1 n 1 b j n 1 b j 1 a j 1 a j a j 1 , , are consecutive terms in sequence F (n) . b j 1 b j b j 1 Taking the first possibility, a j 1 a j 1 b j 1 b j 1 a j a j 1 b j b j 1 aj bj a j 1 b j 1 aj bj a j 1 ki n 1 b j 1 a j 1 a j 1 pa j , b j 1 b j 1 pb j for some integer p . ki a j a j 1 k i , b j b j 1 (n 1) because b j b j 1 2(n 1) n 1 a j 1 a j pa j k i , b j 1 b j pb j (n 1) a j 1 k i a j (1 p), b j 1 (n 1) b j (1 p) a j 1 k i b j 1 (n 1) aj bj ki is the third term in the triplet. An identical n 1 ki proof shows that the equality holds when is the first term of the triplet and so n 1 ki a j 2 a j 1 (n 1) b j 2 b j 1 Thus the equality holds for when Taking the second possibility a j 1 a j 1 b j 1 b j 1 a j 1 a j b j 1 b j a j a j 1 b j b j 1 aj bj a j 1 b j 1 aj a j 1 k i 1 k i , n 1 b j n 1 b j 1 a j 1 a j 1 pa j , b j 1 b j 1 pb j for some integer p . k i 1 a j 1 a j k i 1 , b j 1 b j (n 1) n 1 ki a j a j 1 k i , b j b j 1 (n 1) n 1 k i k i 1 a j 1 2a j a j 1 k i , n 1 k i k i 1 a j (2 p ), n 1 b j 1 2b j b j 1 2 b j (2 p) 2 k i k i 1 a j 2(n 1) b j Thus the equality holds in this case also. We have thus proved by induction that if the equality holds for F (n) , then it must hold for F (n 1) which completes the proof of the Theorem.