Abstract
An O(log n) algorithm for computing the nth convergents of periodic continued fractions is presented. It can be applied to solve the second-order linear recurrences with constant coeffients very efficiently. We also use it to approximate the quadratic numbers in O(log m) time for a result with m-digit precision. Our method can be thought as a generalization of the matrix-vector approach for computing the Fibonacci numbers. It is easy to implement because there are only some matrix multiplications and a division operation involved.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.