Positive generalized continued fraction
= Positive generalized continued fraction
For positive $a_j,b_j$, define $p_0=a_0$, $p_{-1}=1$, $q_0=1$, $q_{-1}=0$ and
$$
p_j=a_jp_{j-1}+b_{j-1}p_{j-2},
\qquad
q_j=a_jq_{j-1}+b_{j-1}q_{j-2}.
$$
Then
$$
\begin{pmatrix}p_n&b_np_{n-1}\\q_n&b_nq_{n-1}\end{pmatrix}
=\prod_{j=0}^n
\begin{pmatrix}a_j&b_j\\1&0\end{pmatrix},
$$
and $p_n/q_n$ is the corresponding finite generalized continued fraction.