A Motif of Mathematics: History and Application of the Mediant and the Farey Sequence