Compute a FINITE continued fraction of the form


I have found many examples on the net but all of them are either infinite or of a particular number of levels. Any help would be good.

  • 3
    $\begingroup$ You need to define what happens at the bottom and what counts as the number of levels. In particular is it $x-\frac1x$ or $x-\frac1{x-1}$? You can then find a recurrence for the answer and solve it for a closed form $\endgroup$
    – Henry
    Aug 23, 2021 at 23:12
  • $\begingroup$ Do you want someone to choose a certain value for $x$ and a finite number of levels? What would it mean otherwise to "compute" the continued fraction? $\endgroup$
    – hardmath
    Aug 23, 2021 at 23:22
  • $\begingroup$ The three dots stand for 1/x. If I am not wrong this yields the recurrence $a_{n+1}=a_{0}-1/a_{n}$ for $n\geq 0$. It is a non-linear recurrence. Is there a solution in terms of $a_0=x$, so $a_n=f(x)$ with a 'nice' expression for $f(x)$? $\endgroup$
    – Vladimir
    Aug 23, 2021 at 23:33
  • $\begingroup$ It is indeed possible to expand a finite continued fraction using its convergents, thanks to its connection with linear fractional transformations. You might want to give this Wikipedia article a read. $\endgroup$ Aug 24, 2021 at 4:15

1 Answer 1


Define $(A_n(x))_{n\geq 0}$ by

$$ A_n(x) = x, \qquad A_{n+1} = x - \frac{1}{A_n(x)}. $$

Then it is easy to check that we can write

$$ A_n(x) = \frac{G_{n+1}(x)}{G_n(x)},$$


$$ G_0(x) = 1, \qquad G_{1}(x) = x, \qquad G_{n+2}(x) = x G_{n+1}(x) - G_n(x). $$

Now note that $F_n(x) = i^{-n} G_n(i x)$ satisfies

$$ F_0(x) = 1, \qquad F_1(x) = x, \qquad F_{n+2}(x) = x F_{n+1}(x) + F_n(x),$$

which is the (shifted) Fibonacci polynomials. This allows us to find the exact formula for the coefficients of $G_n(x)$ in terms of the binomial coefficients.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .