Continued fractions help I'm trying to learn how to express a square root as continued fraction, but I can't get one thing.
The following example of $\sqrt{14}$ is from this page (click the image to see it at full size):

In the 2nd row of the table, can anyone please tell me where the 1 (in red) comes from?
For instance, why can't it be 2, or 3, or 4?
This is my only doubt, which I've been trying hard to understand, but unable to.
 A: Because $1$ is the greatest integer that is $\le \dfrac{\sqrt{14}+3}{5}$. 
Remark: Recall the general continued fraction procedure. At any stage, we are looking at a number $x_n$, which is $\ge 1$ except possibly at the beginning. We compute $a_n=\lfloor x_n\rfloor$. If $a_n\ne x_n$, we define $x_{n+1}$ by
$x_{n+1}=\dfrac{1}{x_n-a_n}$. Then
$$x_n=a_n +\frac{1}{x_{n+1}}.$$
(There is a "better" algorithm for square roots of integers, and related numbers.)
A: More generally, if $x$ is real and $n$ is a natural number, then $$\left\lfloor \frac{x}{n}\right\rfloor = \left\lfloor \frac{\lfloor x\rfloor}{n}\right\rfloor$$
So in computing the continued fraction expansion of a square root of $D$, all the $x_i$ are of the form $$\frac{\sqrt D + A}{B}$$ and to find the integer part of this, we only need to find the integer part of:
$$\frac{\lfloor\sqrt D \rfloor+ A}{B}$$
That greatly simplifies the process of computing the integer parts at each step - the only "approximation" we need for $\sqrt{D}$ to compute this step is $\lfloor \sqrt{D}\rfloor$. Consider how much harder it would be if the $x_i$ could be of the form:
$$\frac{A_i\sqrt{D}+B_i}{C_i}$$
This essentially requirs a "better" estimate for $\sqrt{D}$ to find the integer part of this expression.
