Abstract
We study the problem of computing the k-th term of the Farey sequence of order n, for given n and k. Several methods for generating the entire Farey sequence are known. However, these algorithms require at least quadratic time, since the Farey sequence has Θ(n 2) elements. For the problem of finding the k-th element, we obtain an algorithm that runs in time O(n lg n) and uses space \(O(\sqrt{n})\) . The same bounds hold for the problem of determining the rank in the Farey sequence of a given fraction. A more complicated solution can reduce the space to O(n 1/3(lg lg n)2/3) , and, for the problem of determining the rank of a fraction, reduce the time to O(n). We also argue that an algorithm with running time O(poly(lg n)) is unlikely to exist, since that would give a polynomial-time algorithm for integer factorization.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Bach, E., Shallit, J.: Algorithmic Number Theory. Efficient Algorithms, vol. I. MIT Press, Cambridge (1996)
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. MIT Press and McGraw-Hill (2001)
Deléglise, M., Rivat, J.: Computing the Summation of the Möbius Function. Experimental Mathematics 5, 291–295 (1996)
Farey, J.: On a Curious Property of Vulgar Fractions. London, Edinburgh and Dublin Phil 47, 385 (1816)
Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics: A Foundation for Computer Science, 2nd edn. Addison-Wesley, Reading (1994)
Knuth, D.E.: The Art of Computer Programming, 2nd edn. Seminumerical Algorithms, vol. 2. Addison-Wesley, Reading (1981)
Mitrana, V.: Provocarea algoritmilor. In: Agni, B. (ed.) Romania (1995) (in Romanian)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Pǎtraşcu, C.E., Pǎtraşcu, M. (2004). Computing Order Statistics in the Farey Sequence. In: Buell, D. (eds) Algorithmic Number Theory. ANTS 2004. Lecture Notes in Computer Science, vol 3076. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24847-7_27
Download citation
DOI: https://doi.org/10.1007/978-3-540-24847-7_27
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-22156-2
Online ISBN: 978-3-540-24847-7
eBook Packages: Springer Book Archive