For real numbers $x_1,\ldots,x_k\geq1$ put $$ \la x_1\ra\colon=\frac1{x_1} \quad\mbox{and}\quad \la x_1,\ldots,x_{k+1}\ra=\frac1{x_1+\la x_2,\ldots,x_{k+1}\ra}~. $$ In particular: $$ \la x_1,x_2\ra=\frac1{x_1+\frac1{x_2}}, \la x_1,x_2,x_3\ra=\frac1{x_1+\frac1{x_2+\frac1{x_3}}},\ldots $$ Provided $\theta^k(x)\neq 0$ define for $x\in(0,1)$: $a_1,a_2,\ldots:[0,1)\rar\N$ by $$ a_1(x)\colon=[1/x],\quad a_{k+1}(x)\colon=[1/\theta^k(x)]~. $$ The sequence $a_1(x),a_2(x),\ldots$ is called the continued fraction of $x$. Verify the following statements:
  1. For all $x\in[0,1)$ and all $k\in\N$ such that $x,\theta(x),\ldots,\theta^{k-1}(x)\neq0$: $$ x=\la a_1(x),\ldots,a_k(x)+\theta^k(x)\ra \quad\mbox{and}\quad \theta(x)=\la a_2(x),\ldots,a_k(x)+\theta^k(x)\ra~. $$
  2. For $n_1,\ldots,n_k\in\N$ and $t\in(0,1)$: $$ \theta(\la n_1,\ldots,n_k+t\ra)=\la n_2,\ldots,n_k+t\ra~. $$
  3. Put $I=[0,1)\sm\Q$. For all $k\in\N$ we have $\theta^k(I)\sbe I$. Hence the functions $a_k:I\rar\N$ are defined for all $k\in\N$.
  4. For all $x\in[0,1)\cap\Q$ there is some $k\in\N$ such that $\theta^k(x)=0$.
1. For $k=1$ we have $\la a_1(x)+\theta(x)\ra=\la1/x\ra=x$. Suppose we have: $x=\la a_1(x),\ldots,a_k(x)+\theta^k(x)\ra$, then it follows from $a_n(\theta(x))=a_{n+1}(x)$: $$ \theta(x) =\la a_1(\theta(x)),\ldots,a_k(\theta(x))+\theta^{k+1}(x)\ra =\la a_2(x),\ldots,a_{k+1}(x)+\theta^{k+1}(x)\ra~. $$ Now $1/x=a_1(x)+\theta(x)$ and therefore: $$ 1/x =a_1(x)+\la a_2(x),\ldots,a_{k+1}(x)+\theta^{k+1}(x)\ra \quad\mbox{i.e.}\quad x=\la a_1(x),\ldots,a_{k+1}(x)+\theta^{k+1}(x)\ra~. $$ 2. If $x=\la n_1,\ldots,n_k+t\ra$, then $1/x=n_1+\la n_2,\ldots,n_k+t\ra$ and thus $\theta(x)=\la n_2,\ldots,n_k+t\ra$.
3. Since $1/x=\theta(x)+[1/x]$ we infer that $x$ is irrational, iff $\theta(x)$ is irrational. Hence for all $x\in I$: $\theta^k(x)\in I$.
4. Assume $x=p/q$, $\gcd(p,q)=1$, then $1/x=q/p$; if $p=1$, then $\theta(x)=0$ and $x=\la q\ra$. If $p\geq2$, then $\theta(x)=(q-n_1p)/p$ and $1/\theta(x)=p/(q-n_1p)$; if $q-n_1p=1$, then $\theta^2(x)=0$ otherwise $\theta^2(x)=(p-n_2(q-n_1p))/(q-n_1p)$ and in this case both the numerator and the denominator are strictly smaller the the numerator and the denominator of $x$.