I'm trying to compute the values of differing degrees of continued fractions like $\sqrt 2$, $e$ and other similar fractions. My theory was to take the reduced fraction at an arbitrary depth and the fraction that gets added in the next step and combine them somehow to compute the next deepest fraction.
So for example, $\sqrt 2$ can be expressed first as $\large\frac 1 2$ (the constant $1$ + I figured should be added on at the end) then as $\displaystyle \frac 1 {2 + \frac 1 2}$ which reduces to $\large\frac 2 5$. Then the next step $\displaystyle \frac 1 {2 + \frac 1 {2 + \frac 1 2}}$ which in turn reduces to $\large\frac 5 {12}$.
So in effect, what I'm trying to figure out is how I can go from $\large \frac 1 2$ (knowing the next step is $\large\frac 1 2$) to $\large\frac 2 5$ and then from there again to $\large\frac 5 {12}$ - in a generic way that will work for other continued fractions.
Here's my original attempt ($\frac p q$ is the previously computed fraction, $\frac f g$ is the fraction to add in the next step) which doesn't work at all, but may help you see what I'm trying to do:
$$\frac {p_{n+1}} {q_{n+1}} = \frac {p_n\cdot g_{n+1}+f_{n+1}} {q_n\cdot g_{n+1}+g_{n+1}}$$
Anyways, I'm trying to compute continuous fractions to different depths, preferably inductively, given the previous step and the new fraction to add to the denominator. Any insight you can provide would be wonderful.

If you are looking for a reccurence relation for convergents, for $[a_0;a_1;a_2;\ldots]$ it's $$ \frac{p_{n+1}}{q_{n+1}}=\frac{a_{n+1}p_n+p_{n-1}}{a_{n+1}q_n+q_{n-1}}. $$
P.S. For $\sqrt2=[1;2;2;2;\dots]$ it can be written in even nicer (first-order!) form: $$ \frac{p_{n+1}}{q_{n+1}}=\frac{p_n+2q_n}{p_n+q_n}. $$ Hence (for $\sqrt2$) $$ \begin{pmatrix}p_n\\q_n\end{pmatrix}=\begin{pmatrix}1&2\\1 &1\end{pmatrix}^n\begin{pmatrix}1\\0\end{pmatrix} $$ and it can be computed in $O(\log n)$ time.
(In fact, there is always a formula of this type for periodic continued fraction -- i.e. for quadratic irrationalities. If the period is $T$ it allows to compute $(p_{n+T},q_{n+T})$ knowing only $(p_n,q_n)$. Which, in turn, allows one to compute any convergent in logarithmic time.)