Solution (source code)

= Solution

Let $\beta_{n+1}>0$ be the complete quotient after $a_n$. Part (a) writes the <irrational number> $\theta$ as
$$
\theta=[a_0,\ldots,a_n,\beta_{n+1}],
$$
so $\theta$ lies between the adjacent <continued fraction convergents> $p_n/q_n$ and $p_{n-1}/q_{n-1}$. Their separation is
$$
\left|\frac{p_n}{q_n}-\frac{p_{n-1}}{q_{n-1}}\right|
=\frac1{q_nq_{n-1}}.
$$
Because all $a_j$ are positive integers, the recurrence $q_n=a_nq_{n-1}+q_{n-2}$ implies $q_n\to\infty$. Hence this separation tends to zero, and the <squeeze theorem> gives
$$
\boxed{\frac{p_n}{q_n}\longrightarrow\theta.}
$$