Square root convergents
The problem is not that easy, but still more than 16000 people solved it. I do not like the problem too much since when we reached 1000 iterations, both the numerator and denominator are huge. We need to use vectors(arrays) to store these numbers. The recurrence relation is critical for the continued fraction.
Updated 09/16/2017
with python, one does not need to worry about overflow, and it is very easy to find the relation between numerator and denominator of iteration k and those of iteration k+1. Solved in 13 lines.
No comments:
Post a Comment