When we work with rational numbers, our continued fraction will have a finite number of elements.
Are there ways to estimate the number of elements of a continued fraction when expanding a rational number? For example, in the following form:
"For the chosen rational number N
, continued fraction will contain at least/at most/strictly M
elements"
The obvious way is to implement the continued fraction decomposition algorithm and simply count the number of elements each time the loop passes.
But this method can be quite time-consuming if there are a large number of elements of the continued fraction. I tried to find the answer and the only thing I found was this thread: Nth number of continued fraction
But it ultimately came down to what I said above.