1
$\begingroup$

Question:

How can the value of continued fractions of the form
$$y:=a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cfrac{1}{\begin{align}\ddots& \\ &a_{n-1}+\cfrac{1}{a_n+y}\end{align}}}}}$$
$$a_i\in\lbrace0,1\rbrace$$

be determined efficiently algorithmically, either symbolic or numerically, i.e. exploiting the special nature of the $a_i$.

$\endgroup$
5
  • $\begingroup$ If I do not make a mistake, the equation could we written $y = (p_n+p_{n-1}y)/(q_n+p_{n-1}y)$, where $(p_n)_{n \ge -1}$ and $(q_n)_{n \ge -1}$ are defined by $(p_{-1},q_{-1}) = (1,0)$, $(p_0,q_0)=(a_0,1)$ and the recursion relation $p_n=a_np_{n-1}+p_{n-2}$ and $q_n=a_nq_{n-1}+q_{n-2}$ for all $n \ge 1$. $\endgroup$ Commented Dec 22, 2023 at 10:29
  • $\begingroup$ @ChristopheLeuridan you are right; but it is also a wellknown fact that the values of continued fractions with periodic sequences of integers as $a_i$ and $1$ as numerators must be irrational of type $\frac{p\pm\sqrt{q}}{r},p,q,r\in \mathbb{N}$ $\endgroup$ Commented Dec 22, 2023 at 10:54
  • 1
    $\begingroup$ It may help to note that three consecutive partial quotients $a,0,b$ can be replaced by a single partial quotient $a+b$. $\endgroup$ Commented Dec 22, 2023 at 16:27
  • $\begingroup$ Is there a missing $\text{“}{+}\text{”}$ after $a_0 \text{ ?}$ $\endgroup$ Commented Dec 23, 2023 at 5:25
  • 1
    $\begingroup$ @MichaelHardy you are right; thanks for telling me. $\endgroup$ Commented Dec 23, 2023 at 11:58

1 Answer 1

3
$\begingroup$

Let $p_k/q_k$ be the $k$th convergent of the continued fraction $y=[a_0;a_1,a_2,\dots]$, so that $p_k=a_kp_{k-1}+p_{k-2}$ and $q_k=a_kq_{k-1}+q_{k-2}$ for $k\ge2$, where $a_{k+n}=a_k$ for some natural (period) $n$ and all $k\ge0$. Then we can write $$p_2=A_0p_1+B_0p_0,\quad p_{n+2}=A_1p_1+B_1p_0,\\ p_{2n+2}=A_2p_1+B_2p_0 \tag{1}\label{1}$$ for some integers $A_0,B_0,A_1,B_1,A_2,B_2$. Eliminating $p_1$ and $p_0$ from \eqref{1}, we get $p_{2n+2}=Cp_{n+2}+Dp_2$ for some integers $C,D$. By the periodicity, $$u_m=Cu_{m-1}+Du_{m-2} \tag{2}\label{2}$$ for all $m\ge2$, where $u_m:=p_{nm+2}$, with known $u_0=p_2$ and $u_1=p_{n+2}$. Solving the simple linear difference equation \eqref{2} with constant coefficients, we obtain $u_m=p_{nm+2}=c_+ x_+^m+c_- x_-^m$ for some constants $c_\pm$ and $x_\pm$ and all $m\ge0$ or $u_m=p_{nm+2}=(c_1+c_2 m) x^m$ for some constants $c_1,c_2,x$ and all $m\ge0$. (From there, by the periodicity, we may also want to get $p_k$ for all $k\ge0$.) Similarly, we can get $q_k$ for all $k\ge0$.

Now $y$ is the simple limit, $\lim_k(p_k/q_k)$. In fact, $y=\lim_m(p_{nm+2}/q_{nm+2})$.

In particular, if $p_{nm+2}=c_+ x_+^m+c_- x_-^m$ and, respectively, $q_{nm+2}=d_+ x_+^m+d_- x_-^m$ for some constants $d_\pm$, and if, for instance, $d_+\ne0$ and $|x_+|>|x_-|$, then $y=c_+/d_+$.


The described procedure is illustrated -- for $n=3$ and $(a_0,a_1,a_2)=(1,0,1)$ -- in the pdf image of a Mathematica notebook, so that in this case $y=1+\sqrt2$. In particular, see the graph $\{\frac{p_k}{q_k}\big/ y: k=1,\dots,40\}$ there on p. 2 of the notebook.

$\endgroup$

You must log in to answer this question.

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