  Rational approximations to a square root $\sqrt{k}$ can be produced by
iterating the transformation $f(x) = (dx+k)/(x+d)$ starting from $\infty$ for
any positive integer $d$. We show that these approximations coincide infinitely
often with continued fraction convergents if and only if $4d^2/(k-d^2)$ is an
integer, in which case the continued fraction has a rich structure. It consists
of the concatenation of the continued fractions of certain explicitly definable
rational numbers, and it belongs to one of infinitely many families of
continued fractions whose terms vary linearly in two parameters. We also give
conditions under which the orbit $\{f^n(\infty)\}$ consists exclusively of
convergents or semiconvergents and prove that with few exceptions it includes
all solutions $p/q$ to the Pell equation $p^2 - k q^2 = \pm 1$.
