
# 6.1: Basic Notations

[ "article:topic", "authorname:wraji", "continued fraction" ]

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

In general, a (simple) continued fraction is an expression of the form $a_0 + \frac{1}{a_1+\frac{\displaystyle 1}{\displaystyle a_2+ \ldots}},$ where the letters $$a_0$$, $$\ a_1$$, $$\ a_2$$, $$\ldots$$ denote independent variables, and may be interpreted as one wants (e.g. real or complex numbers, functions, etc.). This expression has precise sense if the number of terms is finite, and may have no meaning for an infinite number of terms. In this section we only discuss the simplest classical setting.

The letters $$\ a_1$$, $$\ a_2$$, $$\ldots$$ denote positive integers. The letter $$a_0$$ denotes an integer.

The following standard notation is very convenient.

We write $[a_0; a_1,a_2, \ldots, a_n] = a_0 + \frac{1}{a_1+\frac{\displaystyle 1} {\displaystyle a_2+ \ldots \genfrac{}{}{0cm}{0}{}{+\frac{\displaystyle 1}{\displaystyle a_n}} }}$ if the number of terms is finite, and $[a_0; a_1,a_2, \ldots] = a_0 + \frac{1}{a_1+\frac{\displaystyle 1}{\displaystyle a_2+ \ldots}}$ for an infinite number of terms.

Still, in the case of infinite number of terms a certain amount of work must be carried out in order to make the above formula meaningful. At the same time, for the finite number of terms the formula makes sense.

$[-2;1,3,5] = -2 + 1/(1+1/(3+1/5)) = -2+1/(1+5/16) = -2+1/(21/16) = -2+16/21 = -26/21$

For a finite continued fraction $$[a_0;a_1,a_2, \ldots, a_n]$$ and a positive integer $$k \leq n$$, the $$k$$-th remainder is defined as the continued fraction $r_k=[a_k;a_{k+1}, a_{k+2}, \ldots, a_n].$

Similarly, for an infinite continued fraction $$[a_0;a_1,a_2, \ldots]$$ and a positive integer $$k$$, the $$k$$-th remainder is defined as the continued fraction $r_k=[a_k;a_{k+1}, a_{k+2}, \ldots].$

Thus, at least in the case of a finite continued fraction, $\alpha=[a_0;a_1,a_2,\ldots, a_n] =a_0+1/(a_1+1/(a_2+ \ldots +1/a_n))$ we have $\label{remainder} \alpha = a_0+1/(a_1+1/(a_2+ \ldots +1/(a_{k-1}+1/r_k) )) = "[a_0;a_1,a_2,\ldots, a_{k-1},r_k]"$ for any positive $$k\leq n$$. Quotation signs appear because we consider the expressions of this kind only with integer entries but the quantity $$r_k$$ may be a non-integer.

It is not difficult to expand any rational number $$\alpha$$ into a continued fraction. Indeed, let $$a_0=[\alpha]$$ be the greatest integer not exceeding $$\alpha$$. Thus the difference $$\delta=\alpha - a_0 <1$$ and, of course, $$\delta \geq 0$$. If $$\delta = 0$$ then we are done. Otherwise put $$r_1 = 1/\delta$$, find $$a_1=[r_1]$$ and non-negative $$\delta=\alpha_1 - a_1 <1$$. Continue the procedure until you obtain $$\delta = 0$$.

Consider the continued fraction expansion for $$42/31$$. We obtain $$a_0=[42/31]=1$$, $$\delta = 42/31-1=11/31$$. Now $$r_1= 1/\delta=31/11$$ and $$a_1=[\alpha_1]=[31/11]=2$$. The new $$\delta = 31/11-2=9/11$$. Now $$r_2= 1/\delta=11/9$$ and $$a_2=[\alpha_2]=[11/9]=1$$. It follows that $$\delta = 11/9-1 = 2/9$$. Now $$r_3= 1/\delta=9/2$$ and $$a_3=[\alpha_3]=[9/2]=4$$. It follows that $$\delta =9/2-4=1/2$$. Now $$r_4= 1/\delta=2$$ and $$a_4=[\alpha_4]=[2]=2$$. It follows that $$\delta = 2-2=0$$ and we are done.

Thus we have calculated $42/31=[a_0;a_1,a_2,a_3,a_4] = [1;2,1,4,2].$

The above example shows that the algorithm stops after finitely many steps. This is in fact quite a general phenomenon. In order to practice with the introduced notations let us prove a simple but important proposition.

[ratrep] Any rational number can be represented as a finite continued fraction.

Proof. By construction, all remainders are positive rationals. For a positive integer $$k$$ put $$r_k=A/B$$ and let $$a_k=[r_k]$$. Then $\label{l2} r_k-a_k = \frac{A-Ba_k}{B} := \frac{C}{B}.$ with $$C<B$$ because $$r_k - a_k <1$$ by construction. If $$C=0$$, then the algorithm stops at this point and we are done. Assume now that $$C \neq 0$$. It follows from ([remainder]) that $\label{l1} r_k=a_k+\frac{1}{r_{k+1}}.$ Compare now ([l2]) with ([l1]) to find that $r_{k+1} = \frac{B}{C}.$ Since $$C<B$$, the rational number $$r_{k+1}$$ has a denominator which is smaller than the the denominator of the previous remainder $$r_k$$. It follows that after a finite number of steps we obtain an integer (a rational with $$1$$ in the denominator) $$r_n=a_n$$ and the procedure stops at this point.

There appear several natural questions in the connection with Proposition [ratrep].

Is such a continued fraction representation unique? The immediate answer is "no". Here are two "different" continued fraction representations for $$1/2$$: $\frac{1}{2}=[0;2]=[0;1,1].$ However, we require that $$a_n>1$$, where $$a_n$$ is the last element of a finite continued fraction. Then the answer is "yes".

Hint. Make use of the formulas ([main]) below.

From now on we assume that $$a_n>1$$.

Another natural question is about infinite continued fractions and (as one can easily guess) real numbers. The proof of the corresponding result is slightly more involved, and we do not give it here. In this brief introduction we just formulate the result and refer to the literature () for a complete proof. We, however, provide some remarks concerning this result below. In particular, we will explain at some point, what the convergence means.

[realrep] An infinite continued fraction converges and defines a real number. There is a one-to-one correspondence between

$$\bullet$$ all (finite and infinite) continued fractions $$[a_0;a_1,a_2, \ldots]$$ with an integer $$a_0$$ and positive integers $$a_k$$ for $$k>0$$ (and the last term $$a_n>1$$ in the case of finite continued fractions)

and

$$\bullet$$ real numbers.

Note that the algorithm we developed above can be applied to any real number and provides the corresponding continued fraction.

Theorem [realrep] has certain theoretical significance. L.Kronecker (1823-1891) said, "God created the integers; the rest is work of man". Several ways to represent real numbers out of integers are well-known. Theorem [realrep] provides yet another way to fulfill this task. This way is constructive and at the same time is not tied to any particular base (say to decimal or binary decomposition).

We will discuss some examples later.
Exercises

1. Prove that under the assumption $$a_n>1$$ the continued fraction representation given in Proposition [ratrep] is unique. In other words, the correspondence between

$$\bullet$$ finite continued fractions $$[a_0;a_1,a_2, \ldots a_n]$$ with an integer $$a_0$$, positive integers $$a_k$$ for $$k>0$$ and $$a_n>1$$

and

$$\bullet$$ rational numbers

is one-to-one.

### Contributors

• Dr. Wissam Raji, Ph.D., of the American University in Beirut. His work was selected by the Saylor Foundation’s Open Textbook Challenge for public release under a Creative Commons Attribution (CC BY) license.