Math. Appl. 5 (2016), 123–145 DOI: 10.13164/ma.2016.09 ON FAREY TABLE AND ITS COMPRESSION FOR SPACE OPTIMIZATION WITH GUARANTEED ERROR BOUNDS BISWAJIT PARIA, SANJOY PRATIHAR and PARTHA BHOWMICK Abstract. Farey sequences, introduced by such renowned mathematicians as John Farey, Charles Haros, and Augustin-L. Cauchy over 200 years ago, are quite well- known by today in theory of fractions, but its computational perspectives are pos- sibly not yet explored up to its merit. In this paper, we present some novel theoret- ical results and efficient algorithms for representation of a Farey sequence through a Farey table. The ranks of the fractions in a Farey sequence are stored in the Farey table to provide an efficient solution to the rank problem, thereby aiding in and speeding up any application frequently requiring fraction ranks for computational speed-up. As the size of the Farey sequence grows quadratically with its order, the Farey table becomes inadvertently large, which calls for its (lossy) compression up to a permissible error. We have, therefore, proposed two compression schemes to obtain a compressed Farey table (CFT). The necessary analysis has been done in detail to derive the error bound in a CFT. As the final step towards space opti- mization, we have also shown how a CFT can be stored in a 1-dimensional array. Experimental results have been furnished to demonstrate the characteristics and efficiency of a Farey table and its compressed form. 1. Introduction A Farey sequence F n of order n is an (ordered) sequence of irreducible (simple) fractions starting from 0 and ending at 1 with denominators less than or equal to n [5, 7, 9]. Going by this definition, we have F 1 = 0 1 , 1 1 , F 2 = 0 1 , 1 2 , 1 1 , F 3 = 0 1 , 1 3 , 1 2 , 2 3 , 1 1 , F 4 = 0 1 , 1 4 , 1 3 , 1 2 , 2 3 , 3 4 , 1 1 , F 5 = 0 1 , 1 5 , 1 4 , 1 3 , 2 5 , 1 2 , 3 5 , 2 3 , 3 4 , 4 5 , 1 1 , and so on. Such sequences are named after John Farey, who in 1816 conjectured that we can obtain F n easily from F n1 (Section 2.1), which was later proved by Cauchy. Interestingly, Charles Haros had published similar results in 1802, which were not known to Farey or Cauchy [9]. Although many interesting studies and research work related to Farey sequence are found in the theory of fractions [1,4,7,8,11,16–19,24], a limited work has been done so far from the algorithmic point of view. Two major problems concerned with the Farey sequence, which have been addressed in recent time, are the rank problem and the order statistics problem. The rank of a fraction x in a Farey sequence F n is the number of fractions less than or equal to x in F n . Given the order n, the rank problem is to find the rank of a given fraction in F n , whereas MSC (2010): primary 11K36, 11Y16, 11Z05. Keywords: Farey sequence, Farey table, fraction rank, fraction error, rank problem, digital ge- ometry, digital image processing. 123