/[dtapublic]/pubs/books/ucbka/trunk/c_cfr0/c_cfr0.tex
ViewVC logotype

Diff of /pubs/books/ucbka/trunk/c_cfr0/c_cfr0.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dashley, Thu Oct 6 03:15:02 2016 UTC revision 140 by dashley, Mon Jul 3 01:59:16 2017 UTC
# Line 1  Line 1 
1  %$Header: /home/dashley/cvsrep/e3ft_gpl01/e3ft_gpl01/dtaipubs/esrgubka/c_cfr0/c_cfr0.tex,v 1.18 2004/03/12 11:12:35 dtashley Exp $  %$Header$
2    
3  \chapter{\ccfrzerolongtitle{}}  \chapter{\ccfrzerolongtitle{}}
4    
5  \label{ccfr0}  \label{ccfr0}
6    
7  \beginchapterquote{``I began by saying that there is probably less difference  \beginchapterquote{``I began by saying that there is probably less difference
8                       between the positions of a mathematician and a physicist                       between the positions of a mathematician and a physicist
9                       than is generally supposed, and that the most important                       than is generally supposed, and that the most important
10                       seems to me to be this, that the mathematician is in much                       seems to me to be this, that the mathematician is in much
11                       more direct contact with reality \ldots{} mathematical                       more direct contact with reality \ldots{} mathematical
12                       objects are so much more what they seem.  A chair or a                       objects are so much more what they seem.  A chair or a
13                       star is not in the least what it seems to be; the more we think                       star is not in the least what it seems to be; the more we think
14                       of it, the fuzzier its outlines become in the haze of sensation                       of it, the fuzzier its outlines become in the haze of sensation
15                       which surround it; but `2' or `317' has nothing to do with                       which surround it; but `2' or `317' has nothing to do with
16                       sensation, and its properties stand out the more clearly the more                       sensation, and its properties stand out the more clearly the more
17                       closely we scrutinize it.''}                       closely we scrutinize it.''}
18                       {G. H. Hardy \cite{bibref:b:mathematiciansapology:1940}, pp. 128-130}                       {G. H. Hardy \cite{bibref:b:mathematiciansapology:1940}, pp. 128-130}
19                                           \index{Hardy, G. H.}                                           \index{Hardy, G. H.}
20    
21  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24  \section{Introduction}  \section{Introduction}
25  %Section tag: INT0  %Section tag: INT0
26  \label{ccfr0:sint0}  \label{ccfr0:sint0}
27  \index{continued fraction}  \index{continued fraction}
28  \index{continued fraction!definition}  \index{continued fraction!definition}
29    
30  A \emph{finite simple continued fraction} is a fraction of the form  A \emph{finite simple continued fraction} is a fraction of the form
31    
32  \begin{equation}  \begin{equation}
33  \label{eq:ccfr0:int0:00}  \label{eq:ccfr0:int0:00}
34  a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2  a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2
35      + \cfrac{1}{\;\;\;\;\;\;\;\;\;\;\;\;\;\;\ldots + \cfrac{1}{a_n}}}}      + \cfrac{1}{\;\;\;\;\;\;\;\;\;\;\;\;\;\;\ldots + \cfrac{1}{a_n}}}}
36      =      =
37      [a_0; a_1, a_2, \ldots , a_n] ,      [a_0; a_1, a_2, \ldots , a_n] ,
38  \end{equation}  \end{equation}
39    
40  \noindent{}where $a_0 \in \vworkintsetnonneg$ and  \noindent{}where $a_0 \in \vworkintsetnonneg$ and
41  $a_i \in \vworkintsetpos$, $i > 0$.  Each integer  $a_i \in \vworkintsetpos$, $i > 0$.  Each integer
42  $a_i$ is called an \index{continued fraction!element}\emph{element} or  $a_i$ is called an \index{continued fraction!element}\emph{element} or
43  \index{continued fraction!partial quotient}\emph{partial quotient}  \index{continued fraction!partial quotient}\emph{partial quotient}
44  of the continued fraction.  of the continued fraction.
45  We require, except in the case of  We require, except in the case of
46  the continued fraction representation of an integer,  the continued fraction representation of an integer,
47  that the final element $a_n$ not be equal  that the final element $a_n$ not be equal
48  to 1.\footnote{\label{footnote:ccfr0:sint0:00}The reason for  to 1.\footnote{\label{footnote:ccfr0:sint0:00}The reason for
49  this restriction is discussed later.}  this restriction is discussed later.}
50    
51  Continued fractions are quite unwieldly to write and typeset,  Continued fractions are quite unwieldly to write and typeset,
52  and so a continued fraction in the form of (\ref{eq:ccfr0:int0:00})  and so a continued fraction in the form of (\ref{eq:ccfr0:int0:00})
53  is written as $[a_0; a_1, a_2, \ldots , a_n]$.  Note that the  is written as $[a_0; a_1, a_2, \ldots , a_n]$.  Note that the
54  separator between $a_0$ and $a_1$ is a semicolon (`;'), and that all other  separator between $a_0$ and $a_1$ is a semicolon (`;'), and that all other
55  separators are commas (`,').  In some works, commas are used exclusively; and in  separators are commas (`,').  In some works, commas are used exclusively; and in
56  other works, the first element is $a_1$ rather than $a_0$.  Throughout this  other works, the first element is $a_1$ rather than $a_0$.  Throughout this
57  work, the notational conventions illustrated in (\ref{eq:ccfr0:int0:00}) are  work, the notational conventions illustrated in (\ref{eq:ccfr0:int0:00}) are
58  followed.  followed.
59    
60  In this chapter, the framework of continued fractions is presented in the  In this chapter, the framework of continued fractions is presented in the
61  context of finding rational numbers in $F_N$, the Farey series of order $N$,  context of finding rational numbers in $F_N$, the Farey series of order $N$,
62  enclosing an arbitrary $r_I \in \vworkrealsetnonneg$.  The continued fraction  enclosing an arbitrary $r_I \in \vworkrealsetnonneg$.  The continued fraction
63  algorithm presented (Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn})  algorithm presented (Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn})
64  is $O(log N)$, and so is suitable for finding the best rational  is $O(log N)$, and so is suitable for finding the best rational
65  approximations in $F_N$ even when $N$ is very large.  Because our emphasis  approximations in $F_N$ even when $N$ is very large.  Because our emphasis
66  is on practical applications rather than number theory, we don't include more  is on practical applications rather than number theory, we don't include more
67  information than is necessary to understand the applications we have in  information than is necessary to understand the applications we have in
68  mind.  mind.
69    
70  The study of continued  The study of continued
71  fractions is a topic from number theory (a branch of mathematics).  It may be  fractions is a topic from number theory (a branch of mathematics).  It may be
72  counterintuitive to anyone but a number theorist that continued fractions  counterintuitive to anyone but a number theorist that continued fractions
73  can be used to economically find best rational approximations,  can be used to economically find best rational approximations,
74  or that continued fractions are anything but  or that continued fractions are anything but
75  a parlor curiosity.  C.D. Olds (\cite{bibref:b:OldsClassic}, p. 3) comments:  a parlor curiosity.  C.D. Olds (\cite{bibref:b:OldsClassic}, p. 3) comments:
76    
77  \index{Olds, C. D.}  \index{Olds, C. D.}
78    
79  \begin{quote}  \begin{quote}
80  At first glance, nothing seems simpler or less significant than writing a number,  At first glance, nothing seems simpler or less significant than writing a number,
81  for example $\frac{9}{7}$, in the form  for example $\frac{9}{7}$, in the form
82    
83  \begin{equation}  \begin{equation}
84  \frac{9}{7} = 1 + \frac{2}{7} = 1 + \frac{1}{\cfrac{7}{2}}  \frac{9}{7} = 1 + \frac{2}{7} = 1 + \frac{1}{\cfrac{7}{2}}
85              = 1 + \cfrac{1}{3 + \cfrac{1}{2}}              = 1 + \cfrac{1}{3 + \cfrac{1}{2}}
86              = 1 + \cfrac{1}{3 + \cfrac{1}{1 + \cfrac{1}{1}}}.              = 1 + \cfrac{1}{3 + \cfrac{1}{1 + \cfrac{1}{1}}}.
87  \end{equation}  \end{equation}
88    
89  It turns out, however, that fractions of this form, called ``continued  It turns out, however, that fractions of this form, called ``continued
90  fractions'', provide much insight into mathematical problems, particularly into  fractions'', provide much insight into mathematical problems, particularly into
91  the nature of numbers.  the nature of numbers.
92    
93  Continued fractions were studied by the great mathematicians of the seventeenth  Continued fractions were studied by the great mathematicians of the seventeenth
94  and eighteenth centuries and are a subject of active investigation today.  and eighteenth centuries and are a subject of active investigation today.
95  \end{quote}  \end{quote}
96    
97    
98  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
100  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
101  \section{History Of Continued Fractions}  \section{History Of Continued Fractions}
102  %Section tag: HST0  %Section tag: HST0
103  \label{cfr0:hst0}  \label{cfr0:hst0}
104  \index{continued fraction!history of}  \index{continued fraction!history of}
105    
106  The only work we are aware of that explicitly treats the history  The only work we are aware of that explicitly treats the history
107  of continued fractions is \cite{bibref:b:HistoryCfPadeApproxBrezinski}.  of continued fractions is \cite{bibref:b:HistoryCfPadeApproxBrezinski}.
108  Although the history of continued fractions is complex,  Although the history of continued fractions is complex,
109  two points are clear.  First, it is clear that Euclid's \index{Euclid}  two points are clear.  First, it is clear that Euclid's \index{Euclid}
110  GCD algorithm \index{Euclid!GCD algorithm}  GCD algorithm \index{Euclid!GCD algorithm}
111  (Algorithm \ref{alg:ccfr0:sega0:euclidsgcdalgorithm}),  (Algorithm \ref{alg:ccfr0:sega0:euclidsgcdalgorithm}),
112  which was known no later than around 300 B.C.,  which was known no later than around 300 B.C.,
113  represents the historical origin of the continued fraction.  Second,  represents the historical origin of the continued fraction.  Second,
114  it is clear that the utility of the apparatus of continued fractions  it is clear that the utility of the apparatus of continued fractions
115  in finding best rational approximations---specifically the properties  in finding best rational approximations---specifically the properties
116  of convergents---was understood by the 17th century.  of convergents---was understood by the 17th century.
117    
118  In this section, we present some excerpts from  In this section, we present some excerpts from
119  \cite{bibref:b:HistoryCfPadeApproxBrezinski}  \cite{bibref:b:HistoryCfPadeApproxBrezinski}
120  which show the very early use of continued fractions to obtain best rational  which show the very early use of continued fractions to obtain best rational
121  approximations with a numerator and denominator less than certain  approximations with a numerator and denominator less than certain
122  prescribed limits.  prescribed limits.
123  We simply demonstrate that the technique we present was known by  We simply demonstrate that the technique we present was known by
124  the 17th century (with the possible exception of the  the 17th century (with the possible exception of the
125  second component of Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}),  second component of Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}),
126  and we don't attempt to describe the other uses  and we don't attempt to describe the other uses
127  of continued fractions or the significance of continued fractions  of continued fractions or the significance of continued fractions
128  in mathematics or number theory.  in mathematics or number theory.
129    
130  Although we present best rational  Although we present best rational
131  approximations in the context of being able to effectively use  approximations in the context of being able to effectively use
132  processor integer multiplication and division instructions,  processor integer multiplication and division instructions,
133  earlier historical work was aimed at either  earlier historical work was aimed at either
134  providing rational approximations to irrational numbers ($\sqrt{2}$ or $\pi$,  providing rational approximations to irrational numbers ($\sqrt{2}$ or $\pi$,
135  for example), or at determining optimal numbers of gear teeth  for example), or at determining optimal numbers of gear teeth
136  (in mechanical systems).  Naturally, the need for best rational approximations  (in mechanical systems).  Naturally, the need for best rational approximations
137  in the context of computer arithmetic is a relatively recent  in the context of computer arithmetic is a relatively recent
138  development.  development.
139    
140  In the introduction of \cite{bibref:b:HistoryCfPadeApproxBrezinski},  In the introduction of \cite{bibref:b:HistoryCfPadeApproxBrezinski},
141  Brezinski \index{Brezenski, Claude} hints at the broad application and importance  Brezinski \index{Brezenski, Claude} hints at the broad application and importance
142  of continued fractions:  of continued fractions:
143    
144  \begin{quote}  \begin{quote}
145  The history of continued fractions is certainly one of the longest  The history of continued fractions is certainly one of the longest
146  among those of mathematical concepts, since it begins with  among those of mathematical concepts, since it begins with
147  Euclid's algorithm \index{Euclid!GCD algorithm} for the greatest common divisor at least  Euclid's algorithm \index{Euclid!GCD algorithm} for the greatest common divisor at least
148  three centuries B.C.  As it is often the case and like  three centuries B.C.  As it is often the case and like
149  Monsieur Jourdain in Moli\`ere's ``le bourgeois gentilhomme''  Monsieur Jourdain in Moli\`ere's ``le bourgeois gentilhomme''
150  (who was speaking in prose though he did not know he was doing so),  (who was speaking in prose though he did not know he was doing so),
151  continued fractions were used for many centuries before their real  continued fractions were used for many centuries before their real
152  discovery.  discovery.
153    
154  The history of continued fractions and Pad\'e approximants is also  The history of continued fractions and Pad\'e approximants is also
155  quite important, since they played a leading role in the development  quite important, since they played a leading role in the development
156  of some branches of mathematics.  For example, they were the basis  of some branches of mathematics.  For example, they were the basis
157  for the proof of the transcendence of $\pi$ in 1882, an open  for the proof of the transcendence of $\pi$ in 1882, an open
158  problem for more than two thousand years, and also for our modern  problem for more than two thousand years, and also for our modern
159  spectral theory of operators.  Actually they still are of great  spectral theory of operators.  Actually they still are of great
160  interest in many fields of pure and applied mathematics and in  interest in many fields of pure and applied mathematics and in
161  numerical analysis, where they provide computer approximations to  numerical analysis, where they provide computer approximations to
162  special functions and are connected to some convergence acceleration  special functions and are connected to some convergence acceleration
163  methods.  Continued fractions are also used in number theory,  methods.  Continued fractions are also used in number theory,
164  computer science, automata, electronics, etc. \ldots{}  computer science, automata, electronics, etc. \ldots{}
165  \end{quote}  \end{quote}
166    
167  Notice that Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}  Notice that Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}
168  has two components.  First, it is shown that the highest-order  has two components.  First, it is shown that the highest-order
169  convergent with an acceptable denominator is closer to $a/b$ than  convergent with an acceptable denominator is closer to $a/b$ than
170  any Farey neighbor to this convergent (thus, this convergent must be  any Farey neighbor to this convergent (thus, this convergent must be
171  either a left or right  Farey neighbor of $a/b$).  Second, it is shown  either a left or right  Farey neighbor of $a/b$).  Second, it is shown
172  what the other Farey neighbor must be.  It is historically clear  what the other Farey neighbor must be.  It is historically clear
173  that the properties of convergents as best rational approximations were  that the properties of convergents as best rational approximations were
174  understood by the 17th century (this is the \emph{first} part of  understood by the 17th century (this is the \emph{first} part of
175  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}).  However, it  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}).  However, it
176  is not historically clear when the \emph{second} part of  is not historically clear when the \emph{second} part of
177  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} was discovered.  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} was discovered.
178    
179  Even in Khinchin's \index{Khinchin, A. Ya.} classic work,  Even in Khinchin's \index{Khinchin, A. Ya.} classic work,
180  \cite{bibref:b:KhinchinClassic}, Theorem 15, p. 22, Khinchin stops  \cite{bibref:b:KhinchinClassic}, Theorem 15, p. 22, Khinchin stops
181  just short of the result presented as the second part of  just short of the result presented as the second part of
182  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}.  Khinchin writes:  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}.  Khinchin writes:
183    
184  \begin{quote}  \begin{quote}
185  THEOREM 15.  \em Every best approximation of a number is a convergent  THEOREM 15.  \em Every best approximation of a number is a convergent
186  or an intermediate fraction of the continued fraction representing  or an intermediate fraction of the continued fraction representing
187  that number.  that number.
188  \end{quote}  \end{quote}
189    
190  \noindent{}Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} goes  \noindent{}Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} goes
191  slightly farther than Khinchin's \emph{THEOREM 15}, above.    slightly farther than Khinchin's \emph{THEOREM 15}, above.  
192  Khinchin \index{Khinchin, A. Ya.} states  Khinchin \index{Khinchin, A. Ya.} states
193  that a best approximation will be a convergent or an intermediate  that a best approximation will be a convergent or an intermediate
194  fraction---but Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}  fraction---but Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}
195  goes slightly farther to indicate \emph{exactly which} intermediate fraction  goes slightly farther to indicate \emph{exactly which} intermediate fraction
196  is potentially the best approximation.  Khinchin's \emph{THEOREM 15}  is potentially the best approximation.  Khinchin's \emph{THEOREM 15}
197  is correct, but could be strengthened.  Khinchin's work  is correct, but could be strengthened.  Khinchin's work
198  was first published in 1935.  This raises the [unlikely] possibility  was first published in 1935.  This raises the [unlikely] possibility
199  that the second part of Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}  that the second part of Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}
200  had not been published even as recently as 1935, although  had not been published even as recently as 1935, although
201  we (the authors) don't have the ability to confirm or  we (the authors) don't have the ability to confirm or
202  refute this.  refute this.
203    
204  In \cite{bibref:b:HistoryCfPadeApproxBrezinski}, p. 70, Brezinski  In \cite{bibref:b:HistoryCfPadeApproxBrezinski}, p. 70, Brezinski
205  \index{Brezenski, Claude}  \index{Brezenski, Claude}
206  writes:  writes:
207    
208  \begin{quote}  \begin{quote}
209  In the same period, algorithms equivalent to continued fractions were  In the same period, algorithms equivalent to continued fractions were
210  still used to find approximate values for ratios and to simplify  still used to find approximate values for ratios and to simplify
211  fractions.  We have already mentioned Albert Girard.  fractions.  We have already mentioned Albert Girard.
212    
213  Among the other authors who treated the subject, the most prominent  Among the other authors who treated the subject, the most prominent
214  is Daniel SCHWENTER \index{Schwenter, Daniel}  is Daniel SCHWENTER \index{Schwenter, Daniel}
215  (N\"urnberg, 31.1.1585 - Altdorf, 19.1.1636),  (N\"urnberg, 31.1.1585 - Altdorf, 19.1.1636),
216  who wrote two books ``\emph{Geometriae practicae novae et auctae  who wrote two books ``\emph{Geometriae practicae novae et auctae
217  tractatus}'' published in 1627 and ``\emph{Delicae  tractatus}'' published in 1627 and ``\emph{Delicae
218  Physico-mathematicae}'' which appeared in 1636 followed by a  Physico-mathematicae}'' which appeared in 1636 followed by a
219  second edition in 1651.  second edition in 1651.
220    
221  In his first book, Schwenter found approximations of 177/233 by  In his first book, Schwenter found approximations of 177/233 by
222  finding their g.c.d. and gave the successive convergents  finding their g.c.d. and gave the successive convergents
223  79/104, 19/25, 3/4, 1/1, and 0/1.  His calculations were arranged  79/104, 19/25, 3/4, 1/1, and 0/1.  His calculations were arranged
224  in a table\footnote{The table is reproduced in  in a table\footnote{The table is reproduced in
225  \cite{bibref:b:HistoryCfPadeApproxBrezinski},  \cite{bibref:b:HistoryCfPadeApproxBrezinski},
226  but is omitted here.} \ldots{} although he gave no explanation of the method.  but is omitted here.} \ldots{} although he gave no explanation of the method.
227  \end{quote}  \end{quote}
228    
229  On p. 84, Brezenski \index{Brezenski, Claude} writes:  On p. 84, Brezenski \index{Brezenski, Claude} writes:
230    
231  \begin{quote}  \begin{quote}
232  Wallis \index{Wallis, John} also made use of continued fractions in his book  Wallis \index{Wallis, John} also made use of continued fractions in his book
233  ``\emph{A treatise of algebra both historical and practical}''  ``\emph{A treatise of algebra both historical and practical}''
234  (published in 1685), to approximate ratios with large  (published in 1685), to approximate ratios with large
235  numerators and denominators:  numerators and denominators:
236    
237  \emph{``Before I leave the business of Decimal Parts, and the  \emph{``Before I leave the business of Decimal Parts, and the
238  advantages which in practice may there cause; I have thought fit  advantages which in practice may there cause; I have thought fit
239  here to insert a Process Of Reducing Fractions or Proportions to  here to insert a Process Of Reducing Fractions or Proportions to
240  smaller termes, retaining as near as may be, the just value.}  smaller termes, retaining as near as may be, the just value.}
241    
242  \emph{It was occasion'd by a Problem sent me (as I remember) about the  \emph{It was occasion'd by a Problem sent me (as I remember) about the
243  Year 1663 or 1664, by Dr. Lamplugh the present Bishop of Exeter from  Year 1663 or 1664, by Dr. Lamplugh the present Bishop of Exeter from
244  (his Wives Father) Dr. Davenant then one of the Prebends  (his Wives Father) Dr. Davenant then one of the Prebends
245  Residentaries of the Church of Salisbury, a very worthy Person, of  Residentaries of the Church of Salisbury, a very worthy Person, of
246  great Learning and Modesty; as I mire inderstand from persons  great Learning and Modesty; as I mire inderstand from persons
247  well acquainted with him, and by divers Writings of his which I have seen,  well acquainted with him, and by divers Writings of his which I have seen,
248  though I never had the opportunity of being personally acquainted with him,  though I never had the opportunity of being personally acquainted with him,
249  otherwise than by Letter.  And amongst  otherwise than by Letter.  And amongst
250  his other Learning, he was very well skilled the Mathematicks,  his other Learning, he was very well skilled the Mathematicks,
251  and a diligent Proficient therein.}  and a diligent Proficient therein.}
252    
253  \emph{He sent me (as it abovesaid) a Fraction (which what it was I  \emph{He sent me (as it abovesaid) a Fraction (which what it was I
254  do not now particulary remember) who's Numerator and Denominator  do not now particulary remember) who's Numerator and Denominator
255  were, each of them of about six or seven places; and Proposed to  were, each of them of about six or seven places; and Proposed to
256  find the nearest Fraction in value to it, whose Denominator should  find the nearest Fraction in value to it, whose Denominator should
257  not be greater than 999.''}  not be greater than 999.''}
258    
259  \begin{center}  \begin{center}
260  \rule{3in}{0.3mm}  \\\  \rule{3in}{0.3mm}  \\\
261  \end{center}  \end{center}
262    
263  \begin{center}  \begin{center}
264  \emph{The Problem} \\  \emph{The Problem} \\
265  \end{center}  \end{center}
266    
267  \emph{A Fraction (or Proportion) being assigned, to sind one as near as  \emph{A Fraction (or Proportion) being assigned, to sind one as near as
268  may be equal to it, in Numbers non exceeding a Number given, and in  may be equal to it, in Numbers non exceeding a Number given, and in
269  the smallest Terms.}  the smallest Terms.}
270    
271  \emph{As (for instance), the Fraction $\frac{2684769}{8376571}$ (or the  \emph{As (for instance), the Fraction $\frac{2684769}{8376571}$ (or the
272  Proportion of 2684769 to 8376571) being assigned, to sind one equal to it  Proportion of 2684769 to 8376571) being assigned, to sind one equal to it
273  (if it may be) or at least the next Greater, or the next Lesser,  (if it may be) or at least the next Greater, or the next Lesser,
274  which may be expressed in Numbers not greater than 999; that is, in numbers  which may be expressed in Numbers not greater than 999; that is, in numbers
275  not exceeding three places.}  not exceeding three places.}
276    
277  \begin{center}  \begin{center}
278  \rule{3in}{0.3mm}  \\  \rule{3in}{0.3mm}  \\
279  \end{center}  \end{center}
280    
281  \emph{If the Fraction sought (whose terms are not to be greater than  \emph{If the Fraction sought (whose terms are not to be greater than
282  a Number given) be the Next Greater than a Fraction Proposed; divide the  a Number given) be the Next Greater than a Fraction Proposed; divide the
283  proposed Fractions Denominator by its Numerator:  If the Next-Lesser, then  proposed Fractions Denominator by its Numerator:  If the Next-Lesser, then
284  the Numerator by the Denominator, continuing the Quotient in Decimal  the Numerator by the Denominator, continuing the Quotient in Decimal
285  Parts, to such an Accuracy as shall be sufficient; which Quotient  Parts, to such an Accuracy as shall be sufficient; which Quotient
286  for the Next-Greater, is to be the Denominator answering to the  for the Next-Greater, is to be the Denominator answering to the
287  Numerator 1:  But for the next Lesser, it is to be  Numerator 1:  But for the next Lesser, it is to be
288  the Numerator answering to the Denominator 1:  Completing a Fraction  the Numerator answering to the Denominator 1:  Completing a Fraction
289  as near as shall be necessary to that Proposed, which Fraction I  as near as shall be necessary to that Proposed, which Fraction I
290  call to First Fraction Compleat:  And the same wanting the Appendage of  call to First Fraction Compleat:  And the same wanting the Appendage of
291  Decimal parts, I call, the First Fraction Cartail'd.}  Decimal parts, I call, the First Fraction Cartail'd.}
292    
293  \emph{Khen by this Appendage of the First Fraction,  \emph{Khen by this Appendage of the First Fraction,
294  divide 1 Integer, and by the Integer Number which is Next-Less then  divide 1 Integer, and by the Integer Number which is Next-Less then
295  the sull Quotient, (that is, in case such Quotient be just an  the sull Quotient, (that is, in case such Quotient be just an
296  Interger Number, by the Integer Next-Less than it; but is it be an Interger  Interger Number, by the Integer Next-Less than it; but is it be an Interger
297  with Decimal parts annexed, than by that Integer  with Decimal parts annexed, than by that Integer
298  without those}  without those}
299    
300  \emph{Decimal parts;) multiply both Terms of the first Fraction Compleat,  \emph{Decimal parts;) multiply both Terms of the first Fraction Compleat,
301  (the Numerator and the Denominator;)  And the Products of such  (the Numerator and the Denominator;)  And the Products of such
302  Multiplication, I call the Continual Increments of those Terms respectively.  Multiplication, I call the Continual Increments of those Terms respectively.
303  And so much as the Appendage of Decimal parts in such Continual Increment  And so much as the Appendage of Decimal parts in such Continual Increment
304  wants of 1 Integer, I call the Complements of the Appendage of the  wants of 1 Integer, I call the Complements of the Appendage of the
305  continual Increment.}  continual Increment.}
306    
307  \emph{Then both to the Numerator and the Denominator of the First  \emph{Then both to the Numerator and the Denominator of the First
308  Fraction, add (respectively) its continual Increment, which make the Terms  Fraction, add (respectively) its continual Increment, which make the Terms
309  of the Second Fraction; and these again (respectively)  of the Second Fraction; and these again (respectively)
310  increased by the same Continual  increased by the same Continual
311  Increment, make the Terms of the Third Fraction:  And so onward,  Increment, make the Terms of the Third Fraction:  And so onward,
312  as long as the Fraction so arising hath an Appendage, which is not less  as long as the Fraction so arising hath an Appendage, which is not less
313  than the Complement of the Appendage of the Continual Increment.}  than the Complement of the Appendage of the Continual Increment.}
314    
315  \emph{But where such Appendage becomes less than that Complement,  \emph{But where such Appendage becomes less than that Complement,
316  that Fraction I call the Last of the First Order; which also is to  that Fraction I call the Last of the First Order; which also is to
317  be the First of the Second Order.''}  be the First of the Second Order.''}
318  \end{quote}  \end{quote}
319    
320  Although Wallis' archaic English above is difficult to decipher,  Although Wallis' archaic English above is difficult to decipher,
321  it appears that Wallis is describing the process of  it appears that Wallis is describing the process of
322  obtaining the convergents and intermediate fractions of  obtaining the convergents and intermediate fractions of
323  the continued fraction representation of a rational number.  the continued fraction representation of a rational number.
324    
325  On p. 86, Brezenski writes:  On p. 86, Brezenski writes:
326    
327  \begin{quote}  \begin{quote}
328  We have already mentioned the Dutch mathematician and astronomer  We have already mentioned the Dutch mathematician and astronomer
329  Christiaan HUYGENS \index{Huygens, Christiaan} (The Hague, 14.4.1629 - The Hague, 8.6.1695).  Christiaan HUYGENS \index{Huygens, Christiaan} (The Hague, 14.4.1629 - The Hague, 8.6.1695).
330  He made several contributions to continued fractions and related  He made several contributions to continued fractions and related
331  matters.  matters.
332    
333  In 1682, Huygens built an automatic planetarium.  To this end,  In 1682, Huygens built an automatic planetarium.  To this end,
334  he used continued fractions, as described in his book  he used continued fractions, as described in his book
335  ``\emph{Descriptio automati planetarii}'', which was published  ``\emph{Descriptio automati planetarii}'', which was published
336  after his death (The Hague, 1698).  In one year the earth  after his death (The Hague, 1698).  In one year the earth
337  covers 359$^{\circ}$ $45'$ $40''$ $30'''$ and Saturn 12$^{\circ}$  covers 359$^{\circ}$ $45'$ $40''$ $30'''$ and Saturn 12$^{\circ}$
338  $13'$ $34''$ $18'''$, which gives the ratio 77708431/2640858.  $13'$ $34''$ $18'''$, which gives the ratio 77708431/2640858.
339    
340  For finding the smallest integers whose ratio is close to the preceding  For finding the smallest integers whose ratio is close to the preceding
341  one, he divided the greatest number by the smallest, then the smallest  one, he divided the greatest number by the smallest, then the smallest
342  by the first remainder, and so on, which is Euclid's algorithm.  by the first remainder, and so on, which is Euclid's algorithm.
343  He thus got  He thus got
344    
345  \begin{equation}  \begin{equation}
346  29 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{1 +  29 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{1 +
347  \cfrac{1}{5 + \cfrac{1}{1 + \cfrac{1}{4 + \ldots{}}}}}}}  \cfrac{1}{5 + \cfrac{1}{1 + \cfrac{1}{4 + \ldots{}}}}}}}
348  \nonumber  \nonumber
349  \end{equation}  \end{equation}
350    
351  for the ratio.  for the ratio.
352    
353  The fourth convergent of this continued fraction is 206/7, which  The fourth convergent of this continued fraction is 206/7, which
354  gave him the number of teeth for the gears of his planetarium, only  gave him the number of teeth for the gears of his planetarium, only
355  producing an error of $40'$ in a century! [H. 177], [H. 272].  producing an error of $40'$ in a century! [H. 177], [H. 272].
356    
357  In a work, undated but not after 1687, he treats the general problem:  In a work, undated but not after 1687, he treats the general problem:
358    
359  \emph{``Etant donn\'es deux grands nombres ayant entr'eux un  \emph{``Etant donn\'es deux grands nombres ayant entr'eux un
360  certain rapport, en trouver d'autres plus petits pour les dents  certain rapport, en trouver d'autres plus petits pour les dents
361  des roues qui ne soient pas incommodes par leurs grandeurs et qui  des roues qui ne soient pas incommodes par leurs grandeurs et qui
362  aient entr'eux \`a peu pr\`es le m\^eme rapport,  aient entr'eux \`a peu pr\`es le m\^eme rapport,
363  de telle facon qu'aucun couple de nombres plus petits ne  de telle facon qu'aucun couple de nombres plus petits ne
364  fournisse un rapport plus approchant de la vraie  fournisse un rapport plus approchant de la vraie
365  valeur.''}\footnote{English translation \index{Raspide, Sandrine@de Raspide, Sandrine}  valeur.''}\footnote{English translation \index{Raspide, Sandrine@de Raspide, Sandrine}
366  \cite{bibref:i:sandrinederaspide}:  \cite{bibref:i:sandrinederaspide}:
367  \emph{If we consider two large numbers forming a given ratio,  \emph{If we consider two large numbers forming a given ratio,
368  we need to find another set of smaller numbers for the teeth of the gearwheels,  we need to find another set of smaller numbers for the teeth of the gearwheels,
369  which are not inconvenient in their size and which bear the very same ratio  which are not inconvenient in their size and which bear the very same ratio
370  between them, in such a way that no other pair of smaller numbers  between them, in such a way that no other pair of smaller numbers
371  brings a ratio closer to the actual value.}}  brings a ratio closer to the actual value.}}
372    
373  Thus Huygens was conscious of the property of best approximation  Thus Huygens was conscious of the property of best approximation
374  exhibited by continued fractions.  He explained his method  exhibited by continued fractions.  He explained his method
375  as follows:  as follows:
376    
377  \emph{``Pour trouver donc des nombres plus petits qui expriment  \emph{``Pour trouver donc des nombres plus petits qui expriment
378  approximativement ce rapport, je divise le plus grand des nombres  approximativement ce rapport, je divise le plus grand des nombres
379  par le plus petit, puis le plus petit par le reste de la premi\`ere  par le plus petit, puis le plus petit par le reste de la premi\`ere
380  division et ensuite ce reste par le noveau reste \ldots{}  division et ensuite ce reste par le noveau reste \ldots{}
381  Poursuivant ce calcul aussi longtemps que possible, on parvient  Poursuivant ce calcul aussi longtemps que possible, on parvient
382  enfin par la division \`a un reste 1.''}\footnote{English  enfin par la division \`a un reste 1.''}\footnote{English
383  translation \index{Raspide, Sandrine@de Raspide, Sandrine}  translation \index{Raspide, Sandrine@de Raspide, Sandrine}
384  \cite{bibref:i:sandrinederaspide}:  \emph{Thus to find some smaller numbers that  \cite{bibref:i:sandrinederaspide}:  \emph{Thus to find some smaller numbers that
385  approximately express this ratio, I divide the largest of  approximately express this ratio, I divide the largest of
386  the numbers by the smallest, then the smallest by the  the numbers by the smallest, then the smallest by the
387  remainder of the first division and then this remainder by  remainder of the first division and then this remainder by
388  the new remainder, continuing this calculation as long as possible,  the new remainder, continuing this calculation as long as possible,
389  we finally end up with a division into a remainder of 1.}}  we finally end up with a division into a remainder of 1.}}
390    
391  Then he makes the following comments:  Then he makes the following comments:
392    
393  \emph{``Or, lorsqu'on n\'eglige \`a partir d'une fraction  \emph{``Or, lorsqu'on n\'eglige \`a partir d'une fraction
394  quelconque les derniers termes de la s\'erie et celles qui  quelconque les derniers termes de la s\'erie et celles qui
395  la suivent, et qu'on r\'eduit les autres plus le  la suivent, et qu'on r\'eduit les autres plus le
396  nombre entier \`a un commun d\'enominateur, le rapport de ce  nombre entier \`a un commun d\'enominateur, le rapport de ce
397  dernier au num\'erateur, sera voisin de celui du plus  dernier au num\'erateur, sera voisin de celui du plus
398  petit nombre donn\'e au plus grand; et la diff\'erence  petit nombre donn\'e au plus grand; et la diff\'erence
399  sera si faible qu'il serait impossible d'obtenir un meilleur accord  sera si faible qu'il serait impossible d'obtenir un meilleur accord
400  avec des nombres plus petits.''}\footnote{English  avec des nombres plus petits.''}\footnote{English
401  translation \index{Raspide, Sandrine@de Raspide, Sandrine}  translation \index{Raspide, Sandrine@de Raspide, Sandrine}
402  \cite{bibref:i:sandrinederaspide}:    \cite{bibref:i:sandrinederaspide}:  
403  \emph{However, when, from an ordinary fraction, we neglect  \emph{However, when, from an ordinary fraction, we neglect
404  the last terms of the run and the ones that follow, and when  the last terms of the run and the ones that follow, and when
405  we reduce the others plus the integer to a common denominator,  we reduce the others plus the integer to a common denominator,
406  the ratio of the latter to the numerator will be in the neighborhood  the ratio of the latter to the numerator will be in the neighborhood
407  of the smallest given number to the largest; and the difference will  of the smallest given number to the largest; and the difference will
408  be so small that it would be impossible to obtain a better  be so small that it would be impossible to obtain a better
409  approximation with smaller numbers.}}  approximation with smaller numbers.}}
410    
411  He proves this result and applies it to the continued fraction  He proves this result and applies it to the continued fraction
412  for $\pi$.  for $\pi$.
413    
414  Let us give the opinion of the French astronomer  Let us give the opinion of the French astronomer
415  \index{Delambre, Jean Baptiste Joseph}Jean Baptiste  \index{Delambre, Jean Baptiste Joseph}Jean Baptiste
416  Joseph DELAMBRE (Amiens, 19.9.1749 - Paris, 19.8.1822), about  Joseph DELAMBRE (Amiens, 19.9.1749 - Paris, 19.8.1822), about
417  this part of Huygens' work.  It is quite interesting [H. 108]:  this part of Huygens' work.  It is quite interesting [H. 108]:
418    
419  \emph{`` \ldots{}; enfin il d\'ecrit son plan\'etaire.}\footnote{English  \emph{`` \ldots{}; enfin il d\'ecrit son plan\'etaire.}\footnote{English
420  translation \index{Raspide, Sandrine@de Raspide, Sandrine}  translation \index{Raspide, Sandrine@de Raspide, Sandrine}
421  \cite{bibref:i:sandrinederaspide}:    \cite{bibref:i:sandrinederaspide}:  
422  \emph{\ldots{}; finally, he describes his planetarium.}}  \emph{\ldots{}; finally, he describes his planetarium.}}
423    
424  \emph{Ces sortes de machines ne sont que des objets de  \emph{Ces sortes de machines ne sont que des objets de
425  curiosit\'e pour les amateurs, ils sont absolument inutiles  curiosit\'e pour les amateurs, ils sont absolument inutiles
426  \`a l'Astronomie; celle \index{Huygens, Christiaan}d'Huygens  \`a l'Astronomie; celle \index{Huygens, Christiaan}d'Huygens
427  \'etait destin\'ee \`a montrer  \'etait destin\'ee \`a montrer
428  les mouvements elliptiques des plan\`etes, suivant les id\'ees  les mouvements elliptiques des plan\`etes, suivant les id\'ees
429  de \index{Kepler, Johannes}K\'epler.  Le probl\`eme \`a r\'esoudre \'etait celui-ci:  de \index{Kepler, Johannes}K\'epler.  Le probl\`eme \`a r\'esoudre \'etait celui-ci:
430  Etant donn\'e deux grands nombres, trouver deux autres nombres plus  Etant donn\'e deux grands nombres, trouver deux autres nombres plus
431  pitits et plus commodes, qui soient \`a peu pr\`es dans la m\^eme raison.    pitits et plus commodes, qui soient \`a peu pr\`es dans la m\^eme raison.  
432  Il y emploie les fractions continues, et sans donner la  Il y emploie les fractions continues, et sans donner la
433  th\'eorie analytique de ces fractions, il les applique \`a des  th\'eorie analytique de ces fractions, il les applique \`a des
434  exemples.  Il trouve ainsi le nombre des dents qui'il convient de donner  exemples.  Il trouve ainsi le nombre des dents qui'il convient de donner
435  aux roues.}\footnote{English translation \index{Raspide, Sandrine@de Raspide, Sandrine}  aux roues.}\footnote{English translation \index{Raspide, Sandrine@de Raspide, Sandrine}
436  \cite{bibref:i:sandrinederaspide}:  \emph{These kinds of machines are  \cite{bibref:i:sandrinederaspide}:  \emph{These kinds of machines are
437  mere objects of curiosity for the amateurs, completely useless to astronomy;    mere objects of curiosity for the amateurs, completely useless to astronomy;  
438  Huygens' machine was meant to demonstrate the elliptic movements of the  Huygens' machine was meant to demonstrate the elliptic movements of the
439  planets, following Kepler's ideas.  The problem to solve was the following:  planets, following Kepler's ideas.  The problem to solve was the following:
440  given two large numbers, we need to find two other numbers, smaller and  given two large numbers, we need to find two other numbers, smaller and
441  more convenient, which are more or less in the same ratio.  To achieve  more convenient, which are more or less in the same ratio.  To achieve
442  this, Huygens uses continued ratios, and, without giving the analytic  this, Huygens uses continued ratios, and, without giving the analytic
443  theory of these ratios, he applies it to some examples.  Thus, he is able  theory of these ratios, he applies it to some examples.  Thus, he is able
444  to determine the number of teeth needed for the gearwheels.}}  to determine the number of teeth needed for the gearwheels.}}
445    
446  \emph{Cette propri\'et\'e des fractions continues, para\^{\i}t \`a  \emph{Cette propri\'et\'e des fractions continues, para\^{\i}t \`a
447  \index{Lagrange, Joseph-Louis}Lagrange, une des principales d\'ecouvertes  \index{Lagrange, Joseph-Louis}Lagrange, une des principales d\'ecouvertes
448  d'Huygens.  Cet \'eloge  d'Huygens.  Cet \'eloge
449  un peu exag\'er\'e fut sans doute dict\'e \`a  un peu exag\'er\'e fut sans doute dict\'e \`a
450  Lagrange par l'usage qu'il a su faire de ces fractions dans l'Analyse.  Lagrange par l'usage qu'il a su faire de ces fractions dans l'Analyse.
451  Quelques g\'eom\`etres ont paru douter des avantages de ces fractions et  Quelques g\'eom\`etres ont paru douter des avantages de ces fractions et
452  de l'utilit\'e  de l'utilit\'e
453  qu'elles peuvent avoir dans les recherches analytiques.  Quant au  qu'elles peuvent avoir dans les recherches analytiques.  Quant au
454  probl\`eme des rouages, il nous semble qu'on peut le r\'esoudre d'une  probl\`eme des rouages, il nous semble qu'on peut le r\'esoudre d'une
455  mani\`ere plus simple et plus commode par l'Arithm\'etique ordinaire.  mani\`ere plus simple et plus commode par l'Arithm\'etique ordinaire.
456  Nous avons d\'ej\`a appliqu\'e notre m\'ethode  Nous avons d\'ej\`a appliqu\'e notre m\'ethode
457  aux intercalations du calendrier.  Nous allons l'appliquer aux deux  aux intercalations du calendrier.  Nous allons l'appliquer aux deux
458  exemples choisis par Huyhens.''}\footnote{English  exemples choisis par Huyhens.''}\footnote{English
459  translation \index{Raspide, Sandrine@de Raspide, Sandrine}  translation \index{Raspide, Sandrine@de Raspide, Sandrine}
460  \cite{bibref:i:sandrinederaspide}:  \cite{bibref:i:sandrinederaspide}:
461  \emph{The property of continued fractions seems, to Lagrange,  \emph{The property of continued fractions seems, to Lagrange,
462  one of the main discoveries of Huygens.  This slightly overdone  one of the main discoveries of Huygens.  This slightly overdone
463  praise was probably induced in Lagrange for the use that he made of  praise was probably induced in Lagrange for the use that he made of
464  the fractions in his Analysis.  Some surveyors seemed to have questioned  the fractions in his Analysis.  Some surveyors seemed to have questioned
465  the advantages of these fractions and their use in analytical research.    the advantages of these fractions and their use in analytical research.  
466  As far as the gearing problem is concerned, it seems to us that we can  As far as the gearing problem is concerned, it seems to us that we can
467  solve it in a simpler and easier way with ordinary arithmetic.    solve it in a simpler and easier way with ordinary arithmetic.  
468  We have already applied our methodology to the intercalation of the calendar.    We have already applied our methodology to the intercalation of the calendar.  
469  We are going to apply it to the two examples chosen by Huygens.}}  We are going to apply it to the two examples chosen by Huygens.}}
470    
471  Delambre concludes:  Delambre concludes:
472    
473  \emph{``Les fractions continues ne m'ont jamais paru qu'une chose  \emph{``Les fractions continues ne m'ont jamais paru qu'une chose
474  curieuse qui, au reste, ne servait qu'\`a obscurcir et compliquer et je  curieuse qui, au reste, ne servait qu'\`a obscurcir et compliquer et je
475  n'en ai jamais fait d'usage que pour m'en d\'emontrer  n'en ai jamais fait d'usage que pour m'en d\'emontrer
476  l'inutilit\'e.''}\footnote{English translation  l'inutilit\'e.''}\footnote{English translation
477  \index{Raspide, Sandrine@de Raspide, Sandrine}  \index{Raspide, Sandrine@de Raspide, Sandrine}
478  \cite{bibref:i:sandrinederaspide}:    \cite{bibref:i:sandrinederaspide}:  
479  \emph{Continued fractions never appeared to me as something more  \emph{Continued fractions never appeared to me as something more
480  than a mere curiosity that, at the end of the day, only serves  than a mere curiosity that, at the end of the day, only serves
481  to darken and complicate matters, and I only used them to  to darken and complicate matters, and I only used them to
482  demonstrate their uselessness.}}  demonstrate their uselessness.}}
483    
484  This was not a prophetic view!  This was not a prophetic view!
485  \end{quote}  \end{quote}
486    
487  Thus, it is clear that the use of continued fraction convergents  Thus, it is clear that the use of continued fraction convergents
488  as best rational approximations dates back to at least the  as best rational approximations dates back to at least the
489  17th century (this is the first part of  17th century (this is the first part of
490  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}).  However,  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}).  However,
491  the details of the historical appearance of the second part of  the details of the historical appearance of the second part of
492  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} (the formula  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} (the formula
493  for the other Farey neighbor, Eq. \ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})  for the other Farey neighbor, Eq. \ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
494  are not known to the authors.  are not known to the authors.
495    
496    
497  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
498  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
499  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
500  \section{Overview Of The Apparatus}  \section{Overview Of The Apparatus}
501  %Section tag: PAR0  %Section tag: PAR0
502    
503  The apparatus of continued fractions is best viewed as  The apparatus of continued fractions is best viewed as
504  an alternate apparatus for representing real numbers.  an alternate apparatus for representing real numbers.
505  Knowledge of the first $n$ partial quotients of  Knowledge of the first $n$ partial quotients of
506  the continued fraction representation of a real number  the continued fraction representation of a real number
507  $x$ is equivalent to the knowledge that the number lies  $x$ is equivalent to the knowledge that the number lies
508  in a certain partition (Eqns.    in a certain partition (Eqns.  
509  \ref{eq:ccfr0:spar0:01},  \ref{eq:ccfr0:spar0:01},
510  \ref{eq:ccfr0:spar0:02}, and \ref{eq:ccfr0:spar0:03}).  With additional  \ref{eq:ccfr0:spar0:02}, and \ref{eq:ccfr0:spar0:03}).  With additional
511  partial quotients, the partitions become more restrictive.  partial quotients, the partitions become more restrictive.
512    
513  \begin{equation}  \begin{equation}
514  \label{eq:ccfr0:spar0:01}  \label{eq:ccfr0:spar0:01}
515  (x=[a_0] \vee x=[a_0; \ldots ] ) \leftrightarrow (a_0 \leq x < a_0 + 1)  (x=[a_0] \vee x=[a_0; \ldots ] ) \leftrightarrow (a_0 \leq x < a_0 + 1)
516  \end{equation}  \end{equation}
517    
518  \begin{equation}  \begin{equation}
519  \label{eq:ccfr0:spar0:02}  \label{eq:ccfr0:spar0:02}
520  (x=[a_0; a_1] \vee x=[a_0; a_1, \ldots ] ) \leftrightarrow  (x=[a_0; a_1] \vee x=[a_0; a_1, \ldots ] ) \leftrightarrow
521  \left(  \left(
522  {  {
523  a_0 + \frac{1}{a_1 + 1} < x \leq a_0 + \frac{1}{a_1}  a_0 + \frac{1}{a_1 + 1} < x \leq a_0 + \frac{1}{a_1}
524  }  }
525  \right)  \right)
526  \end{equation}  \end{equation}
527    
528  \begin{equation}  \begin{equation}
529  \label{eq:ccfr0:spar0:03}  \label{eq:ccfr0:spar0:03}
530  \begin{array}{c}  \begin{array}{c}
531   (x=[a_0; a_1, a_2] \vee x=[a_0; a_1, a_2, \ldots ] ) \vspace{0.05in}\\   (x=[a_0; a_1, a_2] \vee x=[a_0; a_1, a_2, \ldots ] ) \vspace{0.05in}\\
532  \updownarrow \vspace{0.0in}\\  \updownarrow \vspace{0.0in}\\
533  \left(  \left(
534  {  {
535  a_0+\cfrac{1}{a_1 + \cfrac{1}{a_2}} \leq x < a_0+\cfrac{1}{a_1 + \cfrac{1}{a_2+1}}  a_0+\cfrac{1}{a_1 + \cfrac{1}{a_2}} \leq x < a_0+\cfrac{1}{a_1 + \cfrac{1}{a_2+1}}
536  }  }
537  \right)  \right)
538  \end{array}  \end{array}
539  \end{equation}  \end{equation}
540    
541  Algorithms for finding the continued fraction representation  Algorithms for finding the continued fraction representation
542  of a real number are best viewed as algorithms for  of a real number are best viewed as algorithms for
543  determining in which partition a real number lies.  However, what is  determining in which partition a real number lies.  However, what is
544  special (for our purposes) is that the partitions imposed by the  special (for our purposes) is that the partitions imposed by the
545  apparatus of continued fractions have a special relationship  apparatus of continued fractions have a special relationship
546  with best rational approximations---namely, that all numbers (both  with best rational approximations---namely, that all numbers (both
547  rational and irrational) with the same partial quotients up to a  rational and irrational) with the same partial quotients up to a
548  point also have the same Farey neighbors up to a certain order.  point also have the same Farey neighbors up to a certain order.
549  Stated more colloquially, the apparatus of continued fractions  Stated more colloquially, the apparatus of continued fractions
550  hacks up the real number line in a way that is especially meaningful  hacks up the real number line in a way that is especially meaningful
551  for finding best rational approximations.  for finding best rational approximations.
552    
553    
554  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
555  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
556  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
557  \section[CF Representation Of Rationals]  \section[CF Representation Of Rationals]
558          {Continued Fraction Representation Of Rational Numbers}          {Continued Fraction Representation Of Rational Numbers}
559  %Section tag:  CRN0  %Section tag:  CRN0
560    
561  Without proof, we present the following algorithm, Algorithm  Without proof, we present the following algorithm, Algorithm
562  \ref{alg:ccfr0:scrn0:akgenalg}, for  \ref{alg:ccfr0:scrn0:akgenalg}, for
563  determining the continued fraction representation (i.e. the partial  determining the continued fraction representation (i.e. the partial
564  quotients) of a non-negative  quotients) of a non-negative
565  rational number $a/b$.  rational number $a/b$.
566    
567  \begin{vworkalgorithmstatementpar}{Continued Fraction Representation Of  \begin{vworkalgorithmstatementpar}{Continued Fraction Representation Of
568                                     A Rational Number \mbox{\boldmath $a/b$}}                                     A Rational Number \mbox{\boldmath $a/b$}}
569  \label{alg:ccfr0:scrn0:akgenalg}  \label{alg:ccfr0:scrn0:akgenalg}
570  \begin{alglvl0}  \begin{alglvl0}
571  \item $k:=-1$.  \item $k:=-1$.
572  \item $divisor_{-1} := a$.  \item $divisor_{-1} := a$.
573  \item $remainder_{-1} := b$.  \item $remainder_{-1} := b$.
574    
575  \item Repeat  \item Repeat
576    
577  \begin{alglvl1}  \begin{alglvl1}
578  \item $k := k + 1$.  \item $k := k + 1$.
579  \item $dividend_k := divisor_{k-1}$.  \item $dividend_k := divisor_{k-1}$.
580  \item $divisor_k  := remainder_{k-1}$.  \item $divisor_k  := remainder_{k-1}$.
581  \item $a_k :=  dividend_k \; div \; divisor_k$.  \item $a_k :=  dividend_k \; div \; divisor_k$.
582  \item $remainder_k := dividend_k \; mod \; divisor_k$.  \item $remainder_k := dividend_k \; mod \; divisor_k$.
583  \end{alglvl1}  \end{alglvl1}
584    
585  \item Until ($remainder_k = 0$).  \item Until ($remainder_k = 0$).
586  \end{alglvl0}  \end{alglvl0}
587  \end{vworkalgorithmstatementpar}  \end{vworkalgorithmstatementpar}
588  %\vworkalgorithmfooter{}  %\vworkalgorithmfooter{}
589    
590  \begin{vworkexamplestatement}  \begin{vworkexamplestatement}
591  \label{ex:ccfr0:scrn0:01}  \label{ex:ccfr0:scrn0:01}
592  Find the continued fraction partial quotients of  Find the continued fraction partial quotients of
593  $67/29$.\footnote{This example is reproduced from  $67/29$.\footnote{This example is reproduced from
594  Olds \cite{bibref:b:OldsClassic}, p. 8.}  Olds \cite{bibref:b:OldsClassic}, p. 8.}
595  \end{vworkexamplestatement}  \end{vworkexamplestatement}
596  \begin{vworkexampleparsection}{Solution}  \begin{vworkexampleparsection}{Solution}
597  \begin{table}  \begin{table}
598  \caption{Continued Fraction Partial Quotients Of $67/29$ (Example \ref{ex:ccfr0:scrn0:01})}  \caption{Continued Fraction Partial Quotients Of $67/29$ (Example \ref{ex:ccfr0:scrn0:01})}
599  \label{tbl:ccfr0:scrn0:01}  \label{tbl:ccfr0:scrn0:01}
600  \begin{center}  \begin{center}
601  \begin{tabular}{|c|c|c|c|c|}  \begin{tabular}{|c|c|c|c|c|}
602  \hline  \hline
603  \small{Index} & \small{$dividend_k$}  & \small{$divisor_k$} & \small{$a_k$}   & \small{$remainder_k$} \\  \small{Index} & \small{$dividend_k$}  & \small{$divisor_k$} & \small{$a_k$}   & \small{$remainder_k$} \\
604  \small{($k$)} &                       &                     &                 &                       \\  \small{($k$)} &                       &                     &                 &                       \\
605  \hline  \hline
606  \hline  \hline
607  \small{-1}    & \small{N/A}           & \small{67}          & \small{N/A}     & \small{29}            \\  \small{-1}    & \small{N/A}           & \small{67}          & \small{N/A}     & \small{29}            \\
608  \hline  \hline
609  \small{0}     & \small{67}            & \small{29}          & \small{2}       & \small{9}             \\  \small{0}     & \small{67}            & \small{29}          & \small{2}       & \small{9}             \\
610  \hline  \hline
611  \small{1}     & \small{29}            & \small{9}           & \small{3}       & \small{2}             \\  \small{1}     & \small{29}            & \small{9}           & \small{3}       & \small{2}             \\
612  \hline  \hline
613  \small{2}     & \small{9}             & \small{2}           & \small{4}       & \small{1}             \\  \small{2}     & \small{9}             & \small{2}           & \small{4}       & \small{1}             \\
614  \hline  \hline
615  \small{3}     & \small{2}             & \small{1}           & \small{2}       & \small{0}             \\  \small{3}     & \small{2}             & \small{1}           & \small{2}       & \small{0}             \\
616  \hline  \hline
617  \end{tabular}  \end{tabular}
618  \end{center}  \end{center}
619  \end{table}  \end{table}
620  Table \ref{tbl:ccfr0:scrn0:01} shows the application of  Table \ref{tbl:ccfr0:scrn0:01} shows the application of
621  Algorithm \ref{alg:ccfr0:scrn0:akgenalg} to find the  Algorithm \ref{alg:ccfr0:scrn0:akgenalg} to find the
622  continued fraction partial quotients of $67/29$.  From  continued fraction partial quotients of $67/29$.  From
623  Table \ref{tbl:ccfr0:scrn0:01}, the continued fraction  Table \ref{tbl:ccfr0:scrn0:01}, the continued fraction
624  representation of $67/29$ is $[2;3,4,2]$.  representation of $67/29$ is $[2;3,4,2]$.
625  \end{vworkexampleparsection}  \end{vworkexampleparsection}
626  \vworkexamplefooter{}  \vworkexamplefooter{}
627    
628  The process of obtaining the continued fraction representation of  The process of obtaining the continued fraction representation of
629  a rational number is a  a rational number is a
630  process of obtaining each partial quotient $a_i$, and then processing the  process of obtaining each partial quotient $a_i$, and then processing the
631  remainder at each step to obtain further partial quotients.  Noting that  remainder at each step to obtain further partial quotients.  Noting that
632  the dividend and divisor at each step come from previous remainders  the dividend and divisor at each step come from previous remainders
633  (except for $k=0$ and $k=1$) allows us to simplify notation from  (except for $k=0$ and $k=1$) allows us to simplify notation from
634  Algorithm \ref{alg:ccfr0:scrn0:akgenalg}.  If $r_i$ is used to  Algorithm \ref{alg:ccfr0:scrn0:akgenalg}.  If $r_i$ is used to
635  denote the remainder from the division that produced $a_i$, the following  denote the remainder from the division that produced $a_i$, the following
636  recursive equations come immediately.  recursive equations come immediately.
637    
638  \begin{equation}  \begin{equation}
639  \label{eq:ccfr0:scrn0:00a}  \label{eq:ccfr0:scrn0:00a}
640  \frac{a}{b}  \frac{a}{b}
641  =  =
642  a_0 + \frac{r_0}{b}  a_0 + \frac{r_0}{b}
643  =  =
644  a_0 + \frac{1}{\frac{b}{r_0}}  a_0 + \frac{1}{\frac{b}{r_0}}
645  , \; 0 < r_0 < b  , \; 0 < r_0 < b
646  \end{equation}  \end{equation}
647    
648  \begin{equation}  \begin{equation}
649  \label{eq:ccfr0:scrn0:00b}  \label{eq:ccfr0:scrn0:00b}
650  \frac{b}{r_0}  \frac{b}{r_0}
651  =  =
652  a_1 + \frac{r_1}{r_0}  a_1 + \frac{r_1}{r_0}
653  , \; 0 < r_1 < r_0  , \; 0 < r_1 < r_0
654  \end{equation}  \end{equation}
655    
656  \begin{equation}  \begin{equation}
657  \label{eq:ccfr0:scrn0:00c}  \label{eq:ccfr0:scrn0:00c}
658  \frac{r_0}{r_1}  \frac{r_0}{r_1}
659  =  =
660  a_2 + \frac{r_2}{r_1}  a_2 + \frac{r_2}{r_1}
661  , \; 0 < r_2 < r_1  , \; 0 < r_2 < r_1
662  \end{equation}  \end{equation}
663    
664  \noindent{}Finally, nearing the termination of  \noindent{}Finally, nearing the termination of
665  Algorithm \ref{alg:ccfr0:scrn0:akgenalg}:  Algorithm \ref{alg:ccfr0:scrn0:akgenalg}:
666    
667  \begin{equation}  \begin{equation}
668  \label{eq:ccfr0:scrn0:00d}  \label{eq:ccfr0:scrn0:00d}
669  \frac{r_{n-3}}{r_{n-2}}  \frac{r_{n-3}}{r_{n-2}}
670  =  =
671  a_{n-1} + \frac{r_{n-1}}{r_{n-2}}  a_{n-1} + \frac{r_{n-1}}{r_{n-2}}
672  , \; 0 < r_{n-1} < r_{n-2}  , \; 0 < r_{n-1} < r_{n-2}
673  \end{equation}  \end{equation}
674    
675  \begin{equation}  \begin{equation}
676  \label{eq:ccfr0:scrn0:00e}  \label{eq:ccfr0:scrn0:00e}
677  \frac{r_{n-2}}{r_{n-1}}  \frac{r_{n-2}}{r_{n-1}}
678  =  =
679  a_n  a_n
680  \end{equation}  \end{equation}
681    
682  A natural question to ask is whether Algorithm \ref{alg:ccfr0:scrn0:akgenalg}  A natural question to ask is whether Algorithm \ref{alg:ccfr0:scrn0:akgenalg}
683  will always terminate---that is, whether we can always find a continued  will always terminate---that is, whether we can always find a continued
684  fraction representation of a rational number.  We present this result  fraction representation of a rational number.  We present this result
685  as Lemma \ref{lem:ccfr0:scrn0:alwaysterminates}.  as Lemma \ref{lem:ccfr0:scrn0:alwaysterminates}.
686    
687  \begin{vworklemmastatement}  \begin{vworklemmastatement}
688  \label{lem:ccfr0:scrn0:alwaysterminates}  \label{lem:ccfr0:scrn0:alwaysterminates}
689  Algorithm \ref{alg:ccfr0:scrn0:akgenalg} will always terminate:  that is,  Algorithm \ref{alg:ccfr0:scrn0:akgenalg} will always terminate:  that is,
690  every rational number has a finite continued fraction representation  every rational number has a finite continued fraction representation
691  $[a_0; a_1, \ldots{} , a_n]$.  $[a_0; a_1, \ldots{} , a_n]$.
692  \end{vworklemmastatement}  \end{vworklemmastatement}
693  \begin{vworklemmaproof}  \begin{vworklemmaproof}
694  Note in Algorithm \ref{alg:ccfr0:scrn0:akgenalg} and in  Note in Algorithm \ref{alg:ccfr0:scrn0:akgenalg} and in
695  (\ref{eq:ccfr0:scrn0:00a}) through (\ref{eq:ccfr0:scrn0:00e})  (\ref{eq:ccfr0:scrn0:00a}) through (\ref{eq:ccfr0:scrn0:00e})
696  that the remainder of one round becomes the divisor of the  that the remainder of one round becomes the divisor of the
697  next round, hence the remainders must form a decreasing sequence  next round, hence the remainders must form a decreasing sequence
698    
699  \begin{equation}  \begin{equation}
700  \label{eq:lem:ccfr0:scrn0:alwaysterminates}  \label{eq:lem:ccfr0:scrn0:alwaysterminates}
701  r_0 > r_1 > r_2 > \ldots{} > r_{n-2} > r_{n-1} ,  r_0 > r_1 > r_2 > \ldots{} > r_{n-2} > r_{n-1} ,
702  \end{equation}  \end{equation}
703    
704  because in general a remainder must be less than the divisor in  because in general a remainder must be less than the divisor in
705  the division that created it.  the division that created it.
706  \end{vworklemmaproof}  \end{vworklemmaproof}
707  \vworklemmafooter{}  \vworklemmafooter{}
708    
709    
710  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
711  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
712  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
713  \section{Convergents And Intermediate Fractions}  \section{Convergents And Intermediate Fractions}
714  %Section tag: CNV0  %Section tag: CNV0
715  \label{ccfr0:scnf0}  \label{ccfr0:scnf0}
716    
717  Lemma \ref{lem:ccfr0:scrn0:alwaysterminates} shows that every  Lemma \ref{lem:ccfr0:scrn0:alwaysterminates} shows that every
718  rational number has a finite continued fraction representation.  A second  rational number has a finite continued fraction representation.  A second
719  reasonable question to ask is whether every finite simple continued  reasonable question to ask is whether every finite simple continued
720  fraction corresponds to a rational number.  The most convincing way  fraction corresponds to a rational number.  The most convincing way
721  to answer that question would be to devise a concrete procedure for  to answer that question would be to devise a concrete procedure for
722  [re-]constructing a rational number from its continued fraction  [re-]constructing a rational number from its continued fraction
723  representation.  representation.
724    
725  Given a finite continued fraction $[a_0; a_1, \ldots{}, a_n]$, it is  Given a finite continued fraction $[a_0; a_1, \ldots{}, a_n]$, it is
726  obvious that a rational number can be constructed using the same  obvious that a rational number can be constructed using the same
727  algebraic technique that would be applied by hand.  Such a technique  algebraic technique that would be applied by hand.  Such a technique
728  involves ``reconstruction from the right'' because we would begin  involves ``reconstruction from the right'' because we would begin
729  by using $a_n$ and then work backwards to $a_0$.  We illustrate  by using $a_n$ and then work backwards to $a_0$.  We illustrate
730  the most obvious technique with an example.  the most obvious technique with an example.
731    
732  \begin{vworkexamplestatement}  \begin{vworkexamplestatement}
733  \label{ex:ccfr0:scnv0:abreconstructionfromright:01}  \label{ex:ccfr0:scnv0:abreconstructionfromright:01}
734  Find a rational number $a/b$ corresponding to the  Find a rational number $a/b$ corresponding to the
735  continued fraction $[2;3,4,2]$.  continued fraction $[2;3,4,2]$.
736  \end{vworkexamplestatement}  \end{vworkexamplestatement}
737  \begin{vworkexampleparsection}{Solution}  \begin{vworkexampleparsection}{Solution}
738  The most obvious technique is to write out the continued fraction and then to  The most obvious technique is to write out the continued fraction and then to
739  algebraically simplify the continued fraction from the bottom up (this  algebraically simplify the continued fraction from the bottom up (this
740  is what we call ``working from the right'', as we begin with $a_n$).  is what we call ``working from the right'', as we begin with $a_n$).
741  (\ref{eq:ccfr0:scnv0:ex:abreconstructionfromright:00}) through  (\ref{eq:ccfr0:scnv0:ex:abreconstructionfromright:00}) through
742  (\ref{eq:ccfr0:scnv0:ex:abreconstructionfromright:02})  (\ref{eq:ccfr0:scnv0:ex:abreconstructionfromright:02})
743  illustrate this technique.  illustrate this technique.
744    
745  \begin{equation}  \begin{equation}
746  \label{eq:ccfr0:scnv0:ex:abreconstructionfromright:00}  \label{eq:ccfr0:scnv0:ex:abreconstructionfromright:00}
747  [2;3,4,2] =  [2;3,4,2] =
748  2 + \cfrac{1}{3 + \cfrac{1}{4 + \cfrac{1}{2}}}  2 + \cfrac{1}{3 + \cfrac{1}{4 + \cfrac{1}{2}}}
749  \end{equation}  \end{equation}
750    
751  \begin{equation}  \begin{equation}
752  \label{eq:ccfr0:scnv0:ex:abreconstructionfromright:01}  \label{eq:ccfr0:scnv0:ex:abreconstructionfromright:01}
753  [2;3,4,2] =  [2;3,4,2] =
754  2 + \cfrac{1}{3 + \cfrac{2}{9}}  2 + \cfrac{1}{3 + \cfrac{2}{9}}
755  \end{equation}  \end{equation}
756    
757  \begin{equation}  \begin{equation}
758  \label{eq:ccfr0:scnv0:ex:abreconstructionfromright:02}  \label{eq:ccfr0:scnv0:ex:abreconstructionfromright:02}
759  [2;3,4,2] =  [2;3,4,2] =
760  2 + \frac{9}{29} = \frac{67}{29}  2 + \frac{9}{29} = \frac{67}{29}
761  \end{equation}  \end{equation}
762    
763  \end{vworkexampleparsection}  \end{vworkexampleparsection}
764  \vworkexamplefooter{}  \vworkexamplefooter{}
765    
766  Although converting a continued fraction $[a_0; a_1, \ldots{}, a_n]$  Although converting a continued fraction $[a_0; a_1, \ldots{}, a_n]$
767  to a rational number working ``from the right'' is the most  to a rational number working ``from the right'' is the most
768  intuitively obvious technique because it mirrors how a  intuitively obvious technique because it mirrors how a
769  continued fraction would most naturally be simplified by  continued fraction would most naturally be simplified by
770  hand, it is also possible to convert a continued fraction to  hand, it is also possible to convert a continued fraction to
771  a rational number ``from the left''.  In all subsequent  a rational number ``from the left''.  In all subsequent
772  discussions we embrace the ``from the left'' technique because  discussions we embrace the ``from the left'' technique because
773  it allows us to more economically calculate \emph{convergents}, which  it allows us to more economically calculate \emph{convergents}, which
774  have special properties, and which we now describe.  have special properties, and which we now describe.
775    
776  \index{continued fraction!convergent}  \index{continued fraction!convergent}
777  The \emph{kth order convergent} of a continued fraction  The \emph{kth order convergent} of a continued fraction
778  $[a_0; a_1, \ldots{}, a_n]$ is the irreducible rational number  $[a_0; a_1, \ldots{}, a_n]$ is the irreducible rational number
779  corresponding to $[a_0; a_1, \ldots{}, a_k]$, $k \leq n$.  corresponding to $[a_0; a_1, \ldots{}, a_k]$, $k \leq n$.
780  In other words, the $k$th order convergent is the irreducible rational number  In other words, the $k$th order convergent is the irreducible rational number
781  corresponding to the first $k+1$ partial quotients of a  corresponding to the first $k+1$ partial quotients of a
782  continued fraction.\footnote{``$k+1$'' because the notational  continued fraction.\footnote{``$k+1$'' because the notational
783  numbering  numbering
784  for partial quotients starts at 0 rather than 1.}  for partial quotients starts at 0 rather than 1.}
785    
786  An $n$th order continued fraction $[a_0; a_1, \ldots{}, a_n]$  An $n$th order continued fraction $[a_0; a_1, \ldots{}, a_n]$
787  has $n+1$ convergents, $[a_0]$,  has $n+1$ convergents, $[a_0]$,
788  $[a_0; a_1]$, \ldots{}, and $[a_0; a_1, \ldots{}, a_n]$.  $[a_0; a_1]$, \ldots{}, and $[a_0; a_1, \ldots{}, a_n]$.
789  We denote the $k$th order convergent as $s_k$, with numerator  We denote the $k$th order convergent as $s_k$, with numerator
790  $p_k$ and denominator $q_k$.  $p_k$ and denominator $q_k$.
791    
792  \begin{vworkexamplestatement}  \begin{vworkexamplestatement}
793  \label{ex:ccfr0:scnv0:convergentexample:01}  \label{ex:ccfr0:scnv0:convergentexample:01}
794  Find all convergents of $[2;3,4,2]$.  Find all convergents of $[2;3,4,2]$.
795  \end{vworkexamplestatement}  \end{vworkexamplestatement}
796  \begin{vworkexampleparsection}{Solution}\hspace{-0.4em}\footnote{Canonically, it is  \begin{vworkexampleparsection}{Solution}\hspace{-0.4em}\footnote{Canonically, it is
797  required that all convergents be irreducible.  Any valid method can be used to  required that all convergents be irreducible.  Any valid method can be used to
798  calculate convergents---including algebraic simplification---so long as the  calculate convergents---including algebraic simplification---so long as the
799  rational numbers obtained are irreducible.}  rational numbers obtained are irreducible.}
800  \begin{equation}  \begin{equation}
801  s_0 = [a_0] = [2] = 2 = \frac{2}{1} = \frac{p_0}{q_0}  s_0 = [a_0] = [2] = 2 = \frac{2}{1} = \frac{p_0}{q_0}
802  \end{equation}  \end{equation}
803    
804  \begin{equation}  \begin{equation}
805  s_1 = [a_0;a_1] = [2;3] = 2 + \frac{1}{3} = \frac{7}{3} = \frac{p_1}{q_1}  s_1 = [a_0;a_1] = [2;3] = 2 + \frac{1}{3} = \frac{7}{3} = \frac{p_1}{q_1}
806  \end{equation}  \end{equation}
807    
808  \begin{equation}  \begin{equation}
809  s_2 = [a_0;a_1,a_2] =  s_2 = [a_0;a_1,a_2] =
810  [2;3,4] =  [2;3,4] =
811  2 + \cfrac{1}{3 + \cfrac{1}{4}} = \frac{30}{13} = \frac{p_2}{q_2}  2 + \cfrac{1}{3 + \cfrac{1}{4}} = \frac{30}{13} = \frac{p_2}{q_2}
812  \end{equation}  \end{equation}
813    
814  \begin{equation}  \begin{equation}
815  s_3 = [a_0;a_1,a_2,a_3] = [2;3,4,2] =  s_3 = [a_0;a_1,a_2,a_3] = [2;3,4,2] =
816  2 + \cfrac{1}{3 + \cfrac{1}{4 + \cfrac{1}{2}}} = \frac{67}{29} = \frac{p_3}{q_3}  2 + \cfrac{1}{3 + \cfrac{1}{4 + \cfrac{1}{2}}} = \frac{67}{29} = \frac{p_3}{q_3}
817  \end{equation}  \end{equation}
818  \end{vworkexampleparsection}  \end{vworkexampleparsection}
819  \vworkexamplefooter{}  \vworkexamplefooter{}
820    
821  We now move on to the question of how to convert a continued fraction  We now move on to the question of how to convert a continued fraction
822  to a rational number ``from the left''.  We present the  to a rational number ``from the left''.  We present the
823  canonical algorithm for construction of convergents ``from the left''.    canonical algorithm for construction of convergents ``from the left''.  
824  In addition  In addition
825  to producing irreducible rational numbers (we prove this property  to producing irreducible rational numbers (we prove this property
826  later), the algorithm is  later), the algorithm is
827  convenient because it is economical---lower-order convergents  convenient because it is economical---lower-order convergents
828  are used in the calculation of higher-order convergents and there  are used in the calculation of higher-order convergents and there
829  are no wasted calculations.  are no wasted calculations.
830    
831  \begin{vworktheoremstatementpar}{Rule For Canonical Construction Of Continued Fraction  \begin{vworktheoremstatementpar}{Rule For Canonical Construction Of Continued Fraction
832                                   Convergents}                                   Convergents}
833  \label{thm:ccfr0:scnv0:canonicalconvergentconstruction}  \label{thm:ccfr0:scnv0:canonicalconvergentconstruction}
834  The numerators $p_i$ and the denominators $q_i$ of the $i$th  The numerators $p_i$ and the denominators $q_i$ of the $i$th
835  convergent $s_i$ of the continued fraction  convergent $s_i$ of the continued fraction
836  $[a_0;a_1, \ldots{} , a_n]$ satisfy the equations  $[a_0;a_1, \ldots{} , a_n]$ satisfy the equations
837    
838  \begin{eqnarray}  \begin{eqnarray}
839  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01}
840  p_i & = & a_i p_{i-1} + p_{i-2}  \\  p_i & = & a_i p_{i-1} + p_{i-2}  \\
841  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02}
842  q_i & = & a_i q_{i-1} + q_{i-2}  q_i & = & a_i q_{i-1} + q_{i-2}
843  \end{eqnarray}  \end{eqnarray}
844    
845  \noindent{}with the initial values  \noindent{}with the initial values
846    
847  \begin{eqnarray}  \begin{eqnarray}
848  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:03}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:03}
849  p_0 = a_0, & & p_1 = a_0 a_1 + 1, \\  p_0 = a_0, & & p_1 = a_0 a_1 + 1, \\
850  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:04}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:04}
851  q_0 = 1, & &   q_1 = a_1 .  q_0 = 1, & &   q_1 = a_1 .
852  \end{eqnarray}  \end{eqnarray}
853  \end{vworktheoremstatementpar}  \end{vworktheoremstatementpar}
854  \begin{vworktheoremproof}\hspace{-0.4em}\footnote{Reproduced nearly  \begin{vworktheoremproof}\hspace{-0.4em}\footnote{Reproduced nearly
855  verbatim from \cite{bibref:b:OldsClassic}, Theorem 1.3, pp. 21-23.}  verbatim from \cite{bibref:b:OldsClassic}, Theorem 1.3, pp. 21-23.}
856  The proof is inductive.  First, the case of $i=2$ is verified,  The proof is inductive.  First, the case of $i=2$ is verified,
857  then an inductive step is used to show that the theorem applies  then an inductive step is used to show that the theorem applies
858  for $i \geq 3$.  for $i \geq 3$.
859    
860  To create a canonical form, we assign  To create a canonical form, we assign
861  $s_0 = [a_0] = p_0/q_0 = a_0/1$.  Thus, in all cases, $p_0 = a_0$  $s_0 = [a_0] = p_0/q_0 = a_0/1$.  Thus, in all cases, $p_0 = a_0$
862  and $q_0 = 1$.  Similarly, to create a unique canonical form,  and $q_0 = 1$.  Similarly, to create a unique canonical form,
863    
864  \begin{equation}  \begin{equation}
865  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:05}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:05}
866  s_1 = [a_0;a_1] = a_0 + \frac{1}{a_1} = \frac{a_0 a_1 + 1}{a_1} = \frac{p_1}{q_1} ,  s_1 = [a_0;a_1] = a_0 + \frac{1}{a_1} = \frac{a_0 a_1 + 1}{a_1} = \frac{p_1}{q_1} ,
867  \end{equation}  \end{equation}
868    
869  \noindent{}and canonically, $p_1 = a_0 a_1 + 1$ and $q_1 = a_1$.  \noindent{}and canonically, $p_1 = a_0 a_1 + 1$ and $q_1 = a_1$.
870    
871  For $i=2$, we need to verify that the algebraic results coincide with the  For $i=2$, we need to verify that the algebraic results coincide with the
872  claims of the theorem.  Simplifying $s_2$ algebraically leads to  claims of the theorem.  Simplifying $s_2$ algebraically leads to
873    
874  \begin{equation}  \begin{equation}
875  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:06}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:06}
876  \begin{array}{c}  \begin{array}{c}
877  s_2 = [a_0;a_1,a_2] =  s_2 = [a_0;a_1,a_2] =
878  a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2}} =  a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2}} =
879  a_0 + \cfrac{1}{\cfrac{a_1 a_2 + 1}{a_2}} = a_0 + \cfrac{a_2}{a_1 a_2 + 1}  \\  a_0 + \cfrac{1}{\cfrac{a_1 a_2 + 1}{a_2}} = a_0 + \cfrac{a_2}{a_1 a_2 + 1}  \\
880  \\  \\
881  =\cfrac{a_0 (a_1 a_2 + 1) + a_2}{a_1 a_2 + 1}  =\cfrac{a_0 (a_1 a_2 + 1) + a_2}{a_1 a_2 + 1}
882  =\cfrac{a_2(a_0 a_1 + 1) + a_0}{a_2 a_1 + 1} .  =\cfrac{a_2(a_0 a_1 + 1) + a_0}{a_2 a_1 + 1} .
883  \end{array}  \end{array}
884  \end{equation}  \end{equation}
885    
886  \noindent{}On the other hand, applying the recursive formula  \noindent{}On the other hand, applying the recursive formula
887  claimed by the theorem (Eqns.  claimed by the theorem (Eqns.
888  \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01},  \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01},
889  \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02}) yields  \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02}) yields
890    
891  \begin{equation}  \begin{equation}
892  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:07}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:07}
893  s_2 = \frac{a_2 p_1 + p_0}{a_2 q_1 + q_0}  s_2 = \frac{a_2 p_1 + p_0}{a_2 q_1 + q_0}
894  = \frac{a_2(a_0 a_1 + 1) + a_0}{a_2 (a_1) + 1} ,  = \frac{a_2(a_0 a_1 + 1) + a_0}{a_2 (a_1) + 1} ,
895  \end{equation}  \end{equation}
896    
897  which, on inspection, is consistent with the results of  which, on inspection, is consistent with the results of
898  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:06}).  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:06}).
899    
900  We now prove the inductive step.  Assume that  We now prove the inductive step.  Assume that
901  the recursive relationships supplied as  the recursive relationships supplied as
902  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01})  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01})
903  and (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02})  and (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02})
904  hold up through some $s_k = p_k/q_k$.  We would like to show that  hold up through some $s_k = p_k/q_k$.  We would like to show that
905  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01})  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01})
906  and (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02})  and (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02})
907  then hold for $s_{k+1}$.  then hold for $s_{k+1}$.
908    
909  $s_k$ is a fraction of the form  $s_k$ is a fraction of the form
910    
911  \begin{equation}  \begin{equation}
912  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:07b}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:07b}
913  s_k  s_k
914  =  =
915  [a_0; a_1, a_2, \ldots , a_k]  [a_0; a_1, a_2, \ldots , a_k]
916  =  =
917  a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2  a_0 + \cfrac{1}{a_1 + \cfrac{1}{a_2
918      + \cfrac{1}{\;\;\;\;\;\;\;\;\;\;\;\;\;\;\ldots +      + \cfrac{1}{\;\;\;\;\;\;\;\;\;\;\;\;\;\;\ldots +
919          \cfrac{1}{a_{k-1} + \cfrac{1}{a_k}}}}} .          \cfrac{1}{a_{k-1} + \cfrac{1}{a_k}}}}} .
920  \end{equation}  \end{equation}
921    
922  In order to form $s_{k+1}$, note that we can replace $a_k$ by  In order to form $s_{k+1}$, note that we can replace $a_k$ by
923  $a_k + 1/a_{k + 1}$.  (Note that there is no requirement  $a_k + 1/a_{k + 1}$.  (Note that there is no requirement
924  in Eqns. \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01},  in Eqns. \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01},
925  \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02},  \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02},
926  \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:06},  \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:06},
927  \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:07},  \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:07},
928  or \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:07b}  or \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:07b}
929  that the partial quotients $a_i$ be integers.)  that the partial quotients $a_i$ be integers.)
930  In other words, we can form a  In other words, we can form a
931  $k$th order continued fraction having the same value as a  $k$th order continued fraction having the same value as a
932  $k+1$th order continued fraction by substituting  $k+1$th order continued fraction by substituting
933  $a_k := a_k + \frac{1}{a_{k + 1}}$.  Using this substitution  $a_k := a_k + \frac{1}{a_{k + 1}}$.  Using this substitution
934  we can calculate $s_{k+1}$ using the same recursive  we can calculate $s_{k+1}$ using the same recursive
935  relationship shown to be valid in calculating $s_k$:  relationship shown to be valid in calculating $s_k$:
936    
937  \begin{equation}  \begin{equation}
938  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:08}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:08}
939  \begin{array}{c}  \begin{array}{c}
940  s_{k+1} =  s_{k+1} =
941  \cfrac  \cfrac
942  {\left( {a_k+\cfrac{1}{a_{k+1}} } \right) p_{k-1} + p_{k-2}}  {\left( {a_k+\cfrac{1}{a_{k+1}} } \right) p_{k-1} + p_{k-2}}
943  {\left( {a_k+\cfrac{1}{a_{k+1}} } \right) q_{k-1} + q_{k-2}}  {\left( {a_k+\cfrac{1}{a_{k+1}} } \right) q_{k-1} + q_{k-2}}
944  =  =
945  \cfrac  \cfrac
946  {(a_k a_{k+1} + 1) p_{k-1} + a_{k+1} p_{k-2}}  {(a_k a_{k+1} + 1) p_{k-1} + a_{k+1} p_{k-2}}
947  {(a_k a_{k+1} + 1) q_{k-1} + a_{k+1} q_{k-2}} \\  {(a_k a_{k+1} + 1) q_{k-1} + a_{k+1} q_{k-2}} \\
948    \\    \\
949  =  =
950  \cfrac  \cfrac
951  {a_{k+1} (a_k p_{k-1} + p_{k-2}) + p_{k-1}}  {a_{k+1} (a_k p_{k-1} + p_{k-2}) + p_{k-1}}
952  {a_{k+1} (a_k q_{k-1} + q_{k-2}) + q_{k-1}}  {a_{k+1} (a_k q_{k-1} + q_{k-2}) + q_{k-1}}
953  \end{array}  \end{array}
954  \end{equation}  \end{equation}
955    
956  Now, we can use the assumption that the recursive relationships  Now, we can use the assumption that the recursive relationships
957  hold for $s_k$, i.e.  hold for $s_k$, i.e.
958    
959  \begin{eqnarray}  \begin{eqnarray}
960  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:09}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:09}
961  p_k = a_k p_{k-1} + p_{k-2} \\  p_k = a_k p_{k-1} + p_{k-2} \\
962  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:10}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:10}
963  q_k = a_k q_{k-1} + q_{k-2}  q_k = a_k q_{k-1} + q_{k-2}
964  \end{eqnarray}  \end{eqnarray}
965    
966  Substituting  Substituting
967  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:09}) and  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:09}) and
968  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:10}) into  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:10}) into
969  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:08}) yields  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:08}) yields
970    
971  \begin{equation}  \begin{equation}
972  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:11}  \label{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:11}
973  s_{k+1} = \frac{p_{k+1}}{q_{k+1}}  s_{k+1} = \frac{p_{k+1}}{q_{k+1}}
974  = \frac{a_{k+1} p_k + p_{k-1}}{a_{k+1} q_k + q_{k-1}}  .  = \frac{a_{k+1} p_k + p_{k-1}}{a_{k+1} q_k + q_{k-1}}  .
975  \end{equation}  \end{equation}
976    
977  \noindent{}This completes the inductive step and the proof.  \noindent{}This completes the inductive step and the proof.
978  \end{vworktheoremproof}  \end{vworktheoremproof}
979  \begin{vworktheoremparsection}{Remarks}  \begin{vworktheoremparsection}{Remarks}
980  Note that this algorithm gives a way to convert a continued fraction  Note that this algorithm gives a way to convert a continued fraction
981  $[a_0;a_1,\ldots{},a_n]$ to a rational number $a/b$, as the value of  $[a_0;a_1,\ldots{},a_n]$ to a rational number $a/b$, as the value of
982  a continued fraction is the value of the final convergent $s_n$.  a continued fraction is the value of the final convergent $s_n$.
983  Note also that it is possible to convert a continued fraction to  Note also that it is possible to convert a continued fraction to
984  a rational number starting from $a_n$ (i.e. working ``from  a rational number starting from $a_n$ (i.e. working ``from
985  the right''), and that starting with $a_n$ is probably the  the right''), and that starting with $a_n$ is probably the
986  more intuitive approach.  more intuitive approach.
987  \end{vworktheoremparsection}  \end{vworktheoremparsection}
988  \vworktheoremfooter{}  \vworktheoremfooter{}
989    
990  It is sometimes convenient to consider a convergent of order  It is sometimes convenient to consider a convergent of order
991  $-1$ (\cite{bibref:b:KhinchinClassic}, p. 5), and for  $-1$ (\cite{bibref:b:KhinchinClassic}, p. 5), and for
992  algebraic convenience to adopt the convention that  algebraic convenience to adopt the convention that
993  $p_{-1} = 1$ and $q_{-1} = 0$.  If this is done, the recursive  $p_{-1} = 1$ and $q_{-1} = 0$.  If this is done, the recursive
994  relationships of Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction}  relationships of Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction}
995  apply for $k \geq 1$ rather than for $k \geq 2$.  All of the subsequent  apply for $k \geq 1$ rather than for $k \geq 2$.  All of the subsequent
996  theorems and proofs assume this convention.  theorems and proofs assume this convention.
997    
998  We now prove several properties of convergents.  We now prove several properties of convergents.
999    
1000  \begin{vworktheoremstatement}  \begin{vworktheoremstatement}
1001  \label{thm:ccfr0:scnv0:crossproductminusone}  \label{thm:ccfr0:scnv0:crossproductminusone}
1002  For all $k \geq 0$,  For all $k \geq 0$,
1003    
1004  \begin{equation}  \begin{equation}
1005  \label{eq:ccfr0:scnv0:thm:crossproductminusone:00}  \label{eq:ccfr0:scnv0:thm:crossproductminusone:00}
1006  q_k p_{k-1} - p_k q_{k-1} = (-1)^k  q_k p_{k-1} - p_k q_{k-1} = (-1)^k
1007  \end{equation}  \end{equation}
1008  \end{vworktheoremstatement}  \end{vworktheoremstatement}
1009  \begin{vworktheoremproof}\hspace{-0.4em}\footnote{From  \begin{vworktheoremproof}\hspace{-0.4em}\footnote{From
1010  \cite{bibref:b:KhinchinClassic}, Theorem 2, p. 5.}  \cite{bibref:b:KhinchinClassic}, Theorem 2, p. 5.}
1011  Multiplying (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01})  Multiplying (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01})
1012  by $p_{k-1}$, multiplying  by $p_{k-1}$, multiplying
1013  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02}) by  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02}) by
1014  $q_{k-1}$, then subtracting the equations yields  $q_{k-1}$, then subtracting the equations yields
1015    
1016  \begin{equation}  \begin{equation}
1017  \label{eq:ccfr0:scnv0:thm:crossproductminusone:01}  \label{eq:ccfr0:scnv0:thm:crossproductminusone:01}
1018  q_k p_{k-1} - p_k q_{k-1} = -(q_{k-1} p_{k-2} - p_{k-1} q_{k-2}) ,  q_k p_{k-1} - p_k q_{k-1} = -(q_{k-1} p_{k-2} - p_{k-1} q_{k-2}) ,
1019  \end{equation}  \end{equation}
1020    
1021  and since $q_0 p_{-1} - p_0 q_{-1} = 1$, the theorem is  and since $q_0 p_{-1} - p_0 q_{-1} = 1$, the theorem is
1022  proved.  proved.
1023  \end{vworktheoremproof}  \end{vworktheoremproof}
1024  \begin{vworktheoremparsection}{Corollary I}  \begin{vworktheoremparsection}{Corollary I}
1025  For all $k \geq 1$,  For all $k \geq 1$,
1026    
1027  \begin{equation}  \begin{equation}
1028  \label{eq:ccfr0:scnv0:thm:crossproductminusone:02}  \label{eq:ccfr0:scnv0:thm:crossproductminusone:02}
1029  \frac{p_{k-1}}{q_{k-1}} - \frac{p_k}{q_k} = \frac{(-1)^k}{q_k q_{k-1}} .  \frac{p_{k-1}}{q_{k-1}} - \frac{p_k}{q_k} = \frac{(-1)^k}{q_k q_{k-1}} .
1030  \end{equation}  \end{equation}
1031  \end{vworktheoremparsection}  \end{vworktheoremparsection}
1032  \begin{vworktheoremproof}  \begin{vworktheoremproof}
1033  (\ref{eq:ccfr0:scnv0:thm:crossproductminusone:02}) can be obtained  (\ref{eq:ccfr0:scnv0:thm:crossproductminusone:02}) can be obtained
1034  in a straightforward way by algebraic operations on  in a straightforward way by algebraic operations on
1035  (\ref{eq:ccfr0:scnv0:thm:crossproductminusone:00}).  (\ref{eq:ccfr0:scnv0:thm:crossproductminusone:00}).
1036  \end{vworktheoremproof}  \end{vworktheoremproof}
1037  %\vworktheoremfooter{}  %\vworktheoremfooter{}
1038    
1039  \begin{vworktheoremstatement}  \begin{vworktheoremstatement}
1040  \label{thm:ccfr0:scnv0:crossproductminusonebacktwo}  \label{thm:ccfr0:scnv0:crossproductminusonebacktwo}
1041  For all $k \geq 1$,  For all $k \geq 1$,
1042    
1043  \begin{equation}  \begin{equation}
1044  q_k p_{k-2} - p_k q_{k-2} = (-1)^{k-1} a_k .  q_k p_{k-2} - p_k q_{k-2} = (-1)^{k-1} a_k .
1045  \end{equation}  \end{equation}
1046  \end{vworktheoremstatement}  \end{vworktheoremstatement}
1047  \begin{vworktheoremproof}\hspace{-0.4em}\footnote{From  \begin{vworktheoremproof}\hspace{-0.4em}\footnote{From
1048  \cite{bibref:b:KhinchinClassic}, Theorem 3, p. 6.}  \cite{bibref:b:KhinchinClassic}, Theorem 3, p. 6.}
1049  By multiplying (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01})  By multiplying (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:01})
1050  by $q_{k-2}$ and  by $q_{k-2}$ and
1051  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02})  (\ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:02})
1052  by $p_{k-2}$ and then subtracting the first from the  by $p_{k-2}$ and then subtracting the first from the
1053  second, we obtain, on the basis of Theorem  second, we obtain, on the basis of Theorem
1054  \ref{thm:ccfr0:scnv0:crossproductminusone},  \ref{thm:ccfr0:scnv0:crossproductminusone},
1055    
1056  \begin{equation}  \begin{equation}
1057  q_k p_{k-2} - p_k q_{k-2}  q_k p_{k-2} - p_k q_{k-2}
1058  = a_k (q_{k-1} p_{k-2} - p_{k-1} q_{k-2}) = (-1)^{k-1} a_k ,  = a_k (q_{k-1} p_{k-2} - p_{k-1} q_{k-2}) = (-1)^{k-1} a_k ,
1059  \end{equation}  \end{equation}
1060  which completes the proof.  which completes the proof.
1061  \end{vworktheoremproof}  \end{vworktheoremproof}
1062  \vworktheoremfooter{}  \vworktheoremfooter{}
1063    
1064  The results in Theorems \ref{thm:ccfr0:scnv0:crossproductminusone}  The results in Theorems \ref{thm:ccfr0:scnv0:crossproductminusone}
1065  and \ref{thm:ccfr0:scnv0:crossproductminusonebacktwo} allow us  and \ref{thm:ccfr0:scnv0:crossproductminusonebacktwo} allow us
1066  to establish the relative ordering of convergents.  to establish the relative ordering of convergents.
1067  Theorems \ref{thm:ccfr0:scnv0:crossproductminusone} and  Theorems \ref{thm:ccfr0:scnv0:crossproductminusone} and
1068  \ref{thm:ccfr0:scnv0:crossproductminusonebacktwo} demonstrate that  \ref{thm:ccfr0:scnv0:crossproductminusonebacktwo} demonstrate that
1069  even-ordered convergents form an increasing sequence and that odd-ordered  even-ordered convergents form an increasing sequence and that odd-ordered
1070  convergents form a decreasing sequence, and that every odd-ordered convergent  convergents form a decreasing sequence, and that every odd-ordered convergent
1071  is greater than every even-ordered convergent.  is greater than every even-ordered convergent.
1072    
1073  \begin{vworktheoremstatement}  \begin{vworktheoremstatement}
1074  \label{thm:ccfr0:scnv0:irreducibility}  \label{thm:ccfr0:scnv0:irreducibility}
1075  For all $k \geq 0$, $s_k = p_k/q_k$ is  For all $k \geq 0$, $s_k = p_k/q_k$ is
1076  irreducible.  irreducible.
1077  \end{vworktheoremstatement}  \end{vworktheoremstatement}
1078  \begin{vworktheoremproof}  \begin{vworktheoremproof}
1079  This proof comes immediately from the form  This proof comes immediately from the form
1080  of (\ref{eq:ccfr0:scnv0:thm:crossproductminusone:00}).  of (\ref{eq:ccfr0:scnv0:thm:crossproductminusone:00}).
1081  Without coprimality of $p_k$ and $q_k$, the difference  Without coprimality of $p_k$ and $q_k$, the difference
1082  of $\pm 1$ is impossible (see  of $\pm 1$ is impossible (see
1083  \cprizeroxrefcomma{}Lemma \ref{lem:cpri0:ppn0:000p}).  \cprizeroxrefcomma{}Lemma \ref{lem:cpri0:ppn0:000p}).
1084  \end{vworktheoremproof}  \end{vworktheoremproof}
1085  %\vworktheoremfooter{}  %\vworktheoremfooter{}
1086    
1087  \begin{vworkexamplestatement}  \begin{vworkexamplestatement}
1088  \label{ex:ccfr0:scrn0:abreconstruction:01}  \label{ex:ccfr0:scrn0:abreconstruction:01}
1089  Find an irreducible rational number $a/b$ corresponding to the  Find an irreducible rational number $a/b$ corresponding to the
1090  continued fraction $[2;3,4,2]$.  continued fraction $[2;3,4,2]$.
1091  \end{vworkexamplestatement}  \end{vworkexamplestatement}
1092  \begin{vworkexampleparsection}{Solution}  \begin{vworkexampleparsection}{Solution}
1093  Application of Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction}  Application of Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction}
1094  yields the following convergents.  The final convergent $s_3$ is the  yields the following convergents.  The final convergent $s_3$ is the
1095  value of the continued fraction $[2;3,4,2]$ and Theorem  value of the continued fraction $[2;3,4,2]$ and Theorem
1096  \ref{thm:ccfr0:scnv0:irreducibility} assures us that each convergent is  \ref{thm:ccfr0:scnv0:irreducibility} assures us that each convergent is
1097  irreducible.  irreducible.
1098    
1099  \begin{equation}  \begin{equation}
1100  \label{eq:ccfr0:scrn0:02a}  \label{eq:ccfr0:scrn0:02a}
1101  p_{-1} = 1, \; q_{-1} = 0  p_{-1} = 1, \; q_{-1} = 0
1102  \end{equation}  \end{equation}
1103    
1104  \begin{equation}  \begin{equation}
1105  \label{eq:ccfr0:scrn0:02b}  \label{eq:ccfr0:scrn0:02b}
1106  s_0 = \frac{p_0}{q_0} = \frac{a_0}{1} = \frac{2}{1}  s_0 = \frac{p_0}{q_0} = \frac{a_0}{1} = \frac{2}{1}
1107  \end{equation}  \end{equation}
1108    
1109  \begin{equation}  \begin{equation}
1110  \label{eq:ccfr0:scrn0:02c}  \label{eq:ccfr0:scrn0:02c}
1111  s_1 = \frac{p_1}{q_1} = \frac{a_1 p_0 + p_{-1}}{a_1 q_0 + q_{-1}}  s_1 = \frac{p_1}{q_1} = \frac{a_1 p_0 + p_{-1}}{a_1 q_0 + q_{-1}}
1112      = \frac{(3)(2) + (1)}{(3)(1)+(0)}      = \frac{(3)(2) + (1)}{(3)(1)+(0)}
1113      = \frac{7}{3}      = \frac{7}{3}
1114  \end{equation}  \end{equation}
1115    
1116  \begin{equation}  \begin{equation}
1117  \label{eq:ccfr0:scrn0:02d}  \label{eq:ccfr0:scrn0:02d}
1118  s_2 = \frac{p_2}{q_2} = \frac{a_2 p_1 + p_{0}}{a_2 q_1 + q_{0}}  s_2 = \frac{p_2}{q_2} = \frac{a_2 p_1 + p_{0}}{a_2 q_1 + q_{0}}
1119      = \frac{(4)(7) + (2)}{(4)(3)+(1)}      = \frac{(4)(7) + (2)}{(4)(3)+(1)}
1120      = \frac{30}{13}      = \frac{30}{13}
1121  \end{equation}  \end{equation}
1122    
1123  \begin{equation}  \begin{equation}
1124  \label{eq:ccfr0:scrn0:02e}  \label{eq:ccfr0:scrn0:02e}
1125  s_3 = \frac{p_3}{q_3} = \frac{a_3 p_2 + p_{1}}{a_3 q_2 + q_{1}}  s_3 = \frac{p_3}{q_3} = \frac{a_3 p_2 + p_{1}}{a_3 q_2 + q_{1}}
1126      = \frac{(2)(30) + (7)}{(2)(13)+(3)}      = \frac{(2)(30) + (7)}{(2)(13)+(3)}
1127      = \frac{67}{29}      = \frac{67}{29}
1128  \end{equation}  \end{equation}
1129    
1130  Note that this result coincides with  Note that this result coincides with
1131  Example \ref{ex:ccfr0:scrn0:01}.  Example \ref{ex:ccfr0:scrn0:01}.
1132  \end{vworkexampleparsection}  \end{vworkexampleparsection}
1133  \vworkexamplefooter{}  \vworkexamplefooter{}
1134    
1135  We've shown in Algorithm \ref{alg:ccfr0:scrn0:akgenalg}  We've shown in Algorithm \ref{alg:ccfr0:scrn0:akgenalg}
1136  that any rational number can be expressed as a continued fraction, and  that any rational number can be expressed as a continued fraction, and
1137  with Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction}  with Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction}
1138  that any finite continued fraction can be converted to a rational  that any finite continued fraction can be converted to a rational
1139  number.  Although we don't say more until Section \ref{ccfr0:scin0},  number.  Although we don't say more until Section \ref{ccfr0:scin0},
1140  it follows directly that any irrational number results in  it follows directly that any irrational number results in
1141  an \emph{infinite} (or non-terminating) continued fraction, and that  an \emph{infinite} (or non-terminating) continued fraction, and that
1142  any infinite continued fraction represents an irrational number.  any infinite continued fraction represents an irrational number.
1143  In the theorems that follow, we don't treat infinite continued  In the theorems that follow, we don't treat infinite continued
1144  fractions with mathematical rigor, because our emphasis is on  fractions with mathematical rigor, because our emphasis is on
1145  specific applications of continued fractions.  specific applications of continued fractions.
1146    
1147  \begin{vworktheoremstatement}  \begin{vworktheoremstatement}
1148  \label{thm:ccfr0:scnv0:evenslessthanoddsgreaterthan}  \label{thm:ccfr0:scnv0:evenslessthanoddsgreaterthan}
1149  For a finite continued fraction representation of  For a finite continued fraction representation of
1150  the [rational] number $\alpha$, every even-ordered convergent  the [rational] number $\alpha$, every even-ordered convergent
1151  is less than $\alpha$ and every odd-ordered convergent is  is less than $\alpha$ and every odd-ordered convergent is
1152  greater than $\alpha$, with the exception of the final convergent  greater than $\alpha$, with the exception of the final convergent
1153  $s_n$, which is equal to $\alpha$.  $s_n$, which is equal to $\alpha$.
1154  For an infinite continued fraction corresponding to the  For an infinite continued fraction corresponding to the
1155  [irrational] real  [irrational] real
1156  number $\alpha$, every even-ordered convergent is less than  number $\alpha$, every even-ordered convergent is less than
1157  $\alpha$, and every odd-ordered convergent is greater than  $\alpha$, and every odd-ordered convergent is greater than
1158  $\alpha$.    $\alpha$.  
1159  \end{vworktheoremstatement}  \end{vworktheoremstatement}
1160  \begin{vworktheoremparsection}{Proof (Informal)}  \begin{vworktheoremparsection}{Proof (Informal)}
1161  In the case of a finite continued fraction, the proof is obvious  In the case of a finite continued fraction, the proof is obvious
1162  and immediate.  Since $s_n$, the final convergent, is equal  and immediate.  Since $s_n$, the final convergent, is equal
1163  to the rational number $\alpha$, Theorems \ref{thm:ccfr0:scnv0:crossproductminusone}  to the rational number $\alpha$, Theorems \ref{thm:ccfr0:scnv0:crossproductminusone}
1164  and \ref{thm:ccfr0:scnv0:crossproductminusonebacktwo} demonstrate this  and \ref{thm:ccfr0:scnv0:crossproductminusonebacktwo} demonstrate this
1165  unequivocally.  unequivocally.
1166    
1167  In the case of an infinite continued fraction,  In the case of an infinite continued fraction,
1168  note the form of the proof of Theorem  note the form of the proof of Theorem
1169  \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction},  \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction},
1170  where the substitution of $a_k := a_k + 1/a_{k+1}$  where the substitution of $a_k := a_k + 1/a_{k+1}$
1171  is made.  It can be demonstrated that for any even-ordered  is made.  It can be demonstrated that for any even-ordered
1172  convergent $s_k$, additional partial quotients (except  convergent $s_k$, additional partial quotients (except
1173  $a_{k+1} = a_n = 1$, which isn't allowed in general or even  $a_{k+1} = a_n = 1$, which isn't allowed in general or even
1174  possible with an infinite continued fraction) can only  possible with an infinite continued fraction) can only
1175  increase the value.  It can similarly be demonstrated that  increase the value.  It can similarly be demonstrated that
1176  additional partial quotients can only decrease the value  additional partial quotients can only decrease the value
1177  of an odd-ordered convergent.  Because the continued fraction  of an odd-ordered convergent.  Because the continued fraction
1178  is infinite, any particular even-ordered convergent will be  is infinite, any particular even-ordered convergent will be
1179  increased if more partial quotients are allowed, and any particular  increased if more partial quotients are allowed, and any particular
1180  odd-ordered convergent will be decreased in value if more  odd-ordered convergent will be decreased in value if more
1181  partial quotients are allowed.  Thus, we can conclude that  partial quotients are allowed.  Thus, we can conclude that
1182  all even-ordered convergents are less than the value of  all even-ordered convergents are less than the value of
1183  $\alpha$, and all odd-ordered convergents are greater  $\alpha$, and all odd-ordered convergents are greater
1184  than the value of $\alpha$.\footnote{To make this proof more  than the value of $\alpha$.\footnote{To make this proof more
1185  formal would require the discussion of \emph{remainders},  formal would require the discussion of \emph{remainders},
1186  which wouldn't contribute to the applications discussed in this  which wouldn't contribute to the applications discussed in this
1187  work.}  work.}
1188  \end{vworktheoremparsection}  \end{vworktheoremparsection}
1189  %\vworktheoremfooter{}  %\vworktheoremfooter{}
1190    
1191  \begin{vworktheoremstatement}  \begin{vworktheoremstatement}
1192  \label{thm:ccfr0:scnv0:minimumrateofconvergentdenominatorincrease}  \label{thm:ccfr0:scnv0:minimumrateofconvergentdenominatorincrease}
1193  For $k \geq 2$,  For $k \geq 2$,
1194    
1195  \begin{equation}  \begin{equation}
1196  q_k \geq 2^{\frac{k-1}{2}} .  q_k \geq 2^{\frac{k-1}{2}} .
1197  \end{equation}  \end{equation}
1198  \end{vworktheoremstatement}  \end{vworktheoremstatement}
1199  \begin{vworktheoremproof}\hspace{-0.4em}\footnote{From  \begin{vworktheoremproof}\hspace{-0.4em}\footnote{From
1200  \cite{bibref:b:KhinchinClassic}, Theorem 12, p. 13.}  \cite{bibref:b:KhinchinClassic}, Theorem 12, p. 13.}
1201  For $k \geq 2$,  For $k \geq 2$,
1202    
1203  \begin{equation}  \begin{equation}
1204  q_k = a_k q_{k-1} + q_{k-2} \geq q_{k-1} + q_{k-2} \geq 2 q_{k-2} .  q_k = a_k q_{k-1} + q_{k-2} \geq q_{k-1} + q_{k-2} \geq 2 q_{k-2} .
1205  \end{equation}  \end{equation}
1206    
1207  Successive application of this inequality yields  Successive application of this inequality yields
1208    
1209  \begin{equation}  \begin{equation}
1210  q_{2k} \geq 2^k q_0 = 2^k, \; q_{2k+1} \geq 2^k q_1 \geq 2^k ,  q_{2k} \geq 2^k q_0 = 2^k, \; q_{2k+1} \geq 2^k q_1 \geq 2^k ,
1211  \end{equation}  \end{equation}
1212    
1213  which proves the theorem.  Thus, the denominators of convergents  which proves the theorem.  Thus, the denominators of convergents
1214  increase at least as rapidly as the terms of a geometric  increase at least as rapidly as the terms of a geometric
1215  progression.  progression.
1216  \end{vworktheoremproof}  \end{vworktheoremproof}
1217  \begin{vworktheoremparsection}{Remarks}  \begin{vworktheoremparsection}{Remarks}
1218  (1) This minimum geometric rate of increase of denominators of convergents is how  (1) This minimum geometric rate of increase of denominators of convergents is how
1219  we make the claim that Algorithms  we make the claim that Algorithms
1220  \ref{alg:ccfr0:scba0:cfenclosingneighborsfn} and  \ref{alg:ccfr0:scba0:cfenclosingneighborsfn} and
1221  \ref{alg:ccfr0:scba0:cffareyneighborfn} are $O(log \; N)$ and  \ref{alg:ccfr0:scba0:cffareyneighborfn} are $O(log \; N)$ and
1222  that Algorithms  that Algorithms
1223  \ref{alg:ccfr0:scba0:cfenclosingneighborsfab}  \ref{alg:ccfr0:scba0:cfenclosingneighborsfab}
1224  and \ref{alg:ccfr0:scba0:cffareyneighborfab} are  and \ref{alg:ccfr0:scba0:cffareyneighborfab} are
1225  $O(log \; max(h_{MAX}, k_{MAX}))$.  $O(log \; max(h_{MAX}, k_{MAX}))$.
1226  (2) This theorem supplies the \emph{minimum} rate of increase,  (2) This theorem supplies the \emph{minimum} rate of increase,
1227  but the demonominators of convergents can increase much faster.  To achieve  but the demonominators of convergents can increase much faster.  To achieve
1228  the minimum rate of increase, every $a_k$ must be 1, which occurs  the minimum rate of increase, every $a_k$ must be 1, which occurs
1229  only with the continued fraction representation of  only with the continued fraction representation of
1230  $\sqrt{5}/2 + 1/2$ (the famous \index{golden ratio}golden ratio).  $\sqrt{5}/2 + 1/2$ (the famous \index{golden ratio}golden ratio).
1231  (See also Exercise \ref{exe:cfr0:sexe0:c01}.)  (See also Exercise \ref{exe:cfr0:sexe0:c01}.)
1232  \end{vworktheoremparsection}  \end{vworktheoremparsection}
1233  \vworktheoremfooter{}  \vworktheoremfooter{}
1234    
1235  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1236    
1237  Since Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction}  Since Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction}
1238  provides a concrete  provides a concrete
1239  procedure for going from a continued fraction $[a_0; a_1, \ldots{} , a_n]$  procedure for going from a continued fraction $[a_0; a_1, \ldots{} , a_n]$
1240  to a rational number $a/b$ that, when Algorithm \ref{alg:ccfr0:scrn0:akgenalg}  to a rational number $a/b$ that, when Algorithm \ref{alg:ccfr0:scrn0:akgenalg}
1241  is applied, will again result in $[a_0; a_1, \ldots{} , a_n]$, we have  is applied, will again result in $[a_0; a_1, \ldots{} , a_n]$, we have
1242  successfully demonstrated that every continued fraction  successfully demonstrated that every continued fraction
1243  $[a_0; a_1, \ldots{} , a_n]$ corresponds to [at least one]  $[a_0; a_1, \ldots{} , a_n]$ corresponds to [at least one]
1244  rational number $a/b$.  rational number $a/b$.
1245    
1246  The next natural questions to ask are questions of representation  The next natural questions to ask are questions of representation
1247  uniqueness and the nature of the mapping between the set of rational numbers  uniqueness and the nature of the mapping between the set of rational numbers
1248  and the set of continued fractions.  For example, will 32/100 and 64/200 have  and the set of continued fractions.  For example, will 32/100 and 64/200 have
1249  the same continued fraction representation $[a_0; a_1, \ldots{} , a_n]$?    the same continued fraction representation $[a_0; a_1, \ldots{} , a_n]$?  
1250  Do two different continued fractions ever correspond  Do two different continued fractions ever correspond
1251  to the same rational number?  We answer these questions now.  to the same rational number?  We answer these questions now.
1252    
1253  Algorithm \ref{alg:ccfr0:scrn0:akgenalg} will produce the  Algorithm \ref{alg:ccfr0:scrn0:akgenalg} will produce the
1254  same $[a_0; a_1, \ldots{} , a_n]$ for any $ia/ib$, i.e. all rational numbers  same $[a_0; a_1, \ldots{} , a_n]$ for any $ia/ib$, i.e. all rational numbers
1255  which are equivalent in value will generate the same continued fraction  which are equivalent in value will generate the same continued fraction
1256  representation (see Lemma \ref{lem:ccfr0:scrn0:aoverbneednotbeirreducible}).  representation (see Lemma \ref{lem:ccfr0:scrn0:aoverbneednotbeirreducible}).
1257    
1258  It was hinted in the introduction (Section  It was hinted in the introduction (Section
1259  \ref{ccfr0:sint0}, Footnote \ref{footnote:ccfr0:sint0:00})  \ref{ccfr0:sint0}, Footnote \ref{footnote:ccfr0:sint0:00})
1260  that, except in the case of representing an integer, it is  that, except in the case of representing an integer, it is
1261  not allowed for the final partial quotient $a_n$ to be 1.  not allowed for the final partial quotient $a_n$ to be 1.
1262  We now explain the reasons why this must be disallowed.  First,  We now explain the reasons why this must be disallowed.  First,
1263  if $a_n = 1$, then $a_{n-1}$ can be increased by 1 and  if $a_n = 1$, then $a_{n-1}$ can be increased by 1 and
1264  the continued fraction can be reduced in order  the continued fraction can be reduced in order
1265  by 1 and while still preserving its value.  For example, it  by 1 and while still preserving its value.  For example, it
1266  can easily be verified that $[1;2,3,3,1]$ and $[1;2,3,4]$  can easily be verified that $[1;2,3,3,1]$ and $[1;2,3,4]$
1267  represent the same number.  However, this observation alone  represent the same number.  However, this observation alone
1268  is not enough to recommend a canonical form---this observation  is not enough to recommend a canonical form---this observation
1269  does not suggest that  $[1;2,3,4]$ should be preferred  does not suggest that  $[1;2,3,4]$ should be preferred
1270  over $[1;2,3,3,1]$.  However, what \emph{can} be noted is that  over $[1;2,3,3,1]$.  However, what \emph{can} be noted is that
1271  that a continued fraction representation with $a_n=1$, $n>0$  that a continued fraction representation with $a_n=1$, $n>0$
1272  cannot be attained using Algorithm \ref{alg:ccfr0:scrn0:akgenalg} or  cannot be attained using Algorithm \ref{alg:ccfr0:scrn0:akgenalg} or
1273  (\ref{eq:ccfr0:scrn0:00a}) through (\ref{eq:ccfr0:scrn0:00e}),  (\ref{eq:ccfr0:scrn0:00a}) through (\ref{eq:ccfr0:scrn0:00e}),
1274  because a form with $a_n=1$, $n>0$ violates the assumption that  because a form with $a_n=1$, $n>0$ violates the assumption that
1275  successive remainders are ever-decreasing (see Eq.  successive remainders are ever-decreasing (see Eq.
1276  \ref{eq:lem:ccfr0:scrn0:alwaysterminates}).  The property that  \ref{eq:lem:ccfr0:scrn0:alwaysterminates}).  The property that
1277  remainders are ever-decreasing is a necessary condition in  remainders are ever-decreasing is a necessary condition in
1278  proofs of some important properties, and so requiring  proofs of some important properties, and so requiring
1279  that $a_n \neq{} 1$, $n>0$  that $a_n \neq{} 1$, $n>0$
1280  is the most natural convention for a canonical form.  is the most natural convention for a canonical form.
1281    
1282  \begin{vworklemmastatement}  \begin{vworklemmastatement}
1283  \label{lem:ccfr0:scrn0:aoverbneednotbeirreducible}  \label{lem:ccfr0:scrn0:aoverbneednotbeirreducible}
1284  Algorithm \ref{alg:ccfr0:scrn0:akgenalg} will  Algorithm \ref{alg:ccfr0:scrn0:akgenalg} will
1285  produce the same result  produce the same result
1286  $[a_0; a_1, \ldots{} , a_n]$ for any  $[a_0; a_1, \ldots{} , a_n]$ for any
1287  $ia/ib$, i.e. $a/b$ need not be reduced before the algorithm  $ia/ib$, i.e. $a/b$ need not be reduced before the algorithm
1288  is applied.  is applied.
1289  \end{vworklemmastatement}  \end{vworklemmastatement}
1290  \begin{vworklemmaproof}  \begin{vworklemmaproof}
1291  Assume that $a/b$ is irreducible, and that $ia/ib$,  Assume that $a/b$ is irreducible, and that $ia/ib$,
1292  $i \in \{ 2, 3, \ldots \}$ is used as input to  $i \in \{ 2, 3, \ldots \}$ is used as input to
1293  the algorithm.  By definition, any rational number  the algorithm.  By definition, any rational number
1294  with the same value as $a/b$ is of the form $ia/ib$,  with the same value as $a/b$ is of the form $ia/ib$,
1295  $i \in \vworkintsetpos$.  $i \in \vworkintsetpos$.
1296  Note that (\ref{eq:ccfr0:scrn0:00a}) through  Note that (\ref{eq:ccfr0:scrn0:00a}) through
1297  (\ref{eq:ccfr0:scrn0:00e}) ``scale up'', while still producing  (\ref{eq:ccfr0:scrn0:00e}) ``scale up'', while still producing
1298  the same partial quotients $[a_0; a_1, \ldots{} , a_n]$.  the same partial quotients $[a_0; a_1, \ldots{} , a_n]$.
1299  Specifically:  Specifically:
1300    
1301  \begin{equation}  \begin{equation}
1302  \label{eq:ccfr0:scrn0:10a}  \label{eq:ccfr0:scrn0:10a}
1303  \frac{ia}{ib}  \frac{ia}{ib}
1304  =  =
1305  a_0 + \frac{ir_0}{ib}  a_0 + \frac{ir_0}{ib}
1306  =  =
1307  a_0 + \frac{1}{\frac{ib}{ir_0}}  a_0 + \frac{1}{\frac{ib}{ir_0}}
1308  \end{equation}  \end{equation}
1309    
1310  \begin{equation}  \begin{equation}
1311  \label{eq:ccfr0:scrn0:10b}  \label{eq:ccfr0:scrn0:10b}
1312  \frac{ib}{ir_0}  \frac{ib}{ir_0}
1313  =  =
1314  a_1 + \frac{ir_1}{ir_0}  a_1 + \frac{ir_1}{ir_0}
1315  \end{equation}  \end{equation}
1316    
1317  \begin{equation}  \begin{equation}
1318  \label{eq:ccfr0:scrn0:10c}  \label{eq:ccfr0:scrn0:10c}
1319  \frac{ir_0}{ir_1}  \frac{ir_0}{ir_1}
1320  =  =
1321  a_2 + \frac{ir_2}{ir_1}  a_2 + \frac{ir_2}{ir_1}
1322  \end{equation}  \end{equation}
1323    
1324  \noindent{}Finally, nearing the termination of  \noindent{}Finally, nearing the termination of
1325  Algorithm \ref{alg:ccfr0:scrn0:akgenalg}:  Algorithm \ref{alg:ccfr0:scrn0:akgenalg}:
1326    
1327  \begin{equation}  \begin{equation}
1328  \label{eq:ccfr0:scrn0:10d}  \label{eq:ccfr0:scrn0:10d}
1329  \frac{ir_{n-3}}{ir_{n-2}}  \frac{ir_{n-3}}{ir_{n-2}}
1330  =  =
1331  a_{n-1} + \frac{ir_{n-1}}{ir_{n-2}}  a_{n-1} + \frac{ir_{n-1}}{ir_{n-2}}
1332  \end{equation}  \end{equation}
1333    
1334  \begin{equation}  \begin{equation}
1335  \label{eq:ccfr0:scrn0:10e}  \label{eq:ccfr0:scrn0:10e}
1336  \frac{ir_{n-2}}{ir_{n-1}}  \frac{ir_{n-2}}{ir_{n-1}}
1337  =  =
1338  a_n  a_n
1339  \end{equation}  \end{equation}
1340    
1341  Thus, it is easy to show that Algorithm \ref{alg:ccfr0:scrn0:akgenalg}  Thus, it is easy to show that Algorithm \ref{alg:ccfr0:scrn0:akgenalg}
1342  will produce the same continued fraction representation regardless of whether  will produce the same continued fraction representation regardless of whether
1343  the input to the algorithm is reduced.  It is also easy to show that the  the input to the algorithm is reduced.  It is also easy to show that the
1344  last non-zero remainder as the algorithm is applied ($r_{n-1}$, in  last non-zero remainder as the algorithm is applied ($r_{n-1}$, in
1345  Eqns. \ref{eq:ccfr0:scrn0:10d} and \ref{eq:ccfr0:scrn0:10e})  Eqns. \ref{eq:ccfr0:scrn0:10d} and \ref{eq:ccfr0:scrn0:10e})
1346  is the greatest common divisor of $ia$ and $ib$ (this is done  is the greatest common divisor of $ia$ and $ib$ (this is done
1347  in the proof of Algorithm \ref{alg:ccfr0:sega0:euclidsgcdalgorithm}).  in the proof of Algorithm \ref{alg:ccfr0:sega0:euclidsgcdalgorithm}).
1348  \end{vworklemmaproof}  \end{vworklemmaproof}
1349  %\vworklemmafooter{}  %\vworklemmafooter{}
1350    
1351  \begin{vworklemmastatement}  \begin{vworklemmastatement}
1352  \label{lem:ccfr0:scrn0:cfrepresentationisunique}  \label{lem:ccfr0:scrn0:cfrepresentationisunique}
1353  So long as $a_n \neq 1$, $n>0$, a rational number $a/b$ has only  So long as $a_n \neq 1$, $n>0$, a rational number $a/b$ has only
1354  one [unique] continued fraction representation  one [unique] continued fraction representation
1355  $[a_0; a_1, \ldots{} , a_n]$.  $[a_0; a_1, \ldots{} , a_n]$.
1356  \end{vworklemmastatement}  \end{vworklemmastatement}
1357  \begin{vworklemmaproof}  \begin{vworklemmaproof}
1358  Assume that two different continued fractions,  Assume that two different continued fractions,
1359  $[a_0; a_1, \ldots{} , a_m]$ and  $[a_0; a_1, \ldots{} , a_m]$ and
1360  $[\overline{a_0}; \overline{a_1}, \ldots{} , \overline{a_n}]$,  $[\overline{a_0}; \overline{a_1}, \ldots{} , \overline{a_n}]$,
1361  correspond to the same rational number $a/b$.  By  correspond to the same rational number $a/b$.  By
1362  \emph{different}, we mean either that $m=n$ but  \emph{different}, we mean either that $m=n$ but
1363  $\exists i, a_i \neq \overline{a_i}$, or that $m \neq n$.  $\exists i, a_i \neq \overline{a_i}$, or that $m \neq n$.
1364    
1365  Note that Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction}  Note that Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction}
1366  will map from any continued fraction to an irreducible rational  will map from any continued fraction to an irreducible rational
1367  number $a/b$.  Assume we apply  number $a/b$.  Assume we apply
1368  Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction} to  Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction} to
1369  $[a_0; a_1, \ldots{} , a_m]$ to produce $a/b$, and  $[a_0; a_1, \ldots{} , a_m]$ to produce $a/b$, and
1370  to $[\overline{a_0}; \overline{a_1}, \ldots{} , \overline{a_n}]$  to $[\overline{a_0}; \overline{a_1}, \ldots{} , \overline{a_n}]$
1371  to produce $\overline{a}/\overline{b}$.  Because two irreducible  to produce $\overline{a}/\overline{b}$.  Because two irreducible
1372  rational numbers are equal iff their components are  rational numbers are equal iff their components are
1373  equal,  equal,
1374  $[(a/b) = (\overline{a}/\overline{b})] \vworkhimp{} %  $[(a/b) = (\overline{a}/\overline{b})] \vworkhimp{} %
1375  [(a = \overline{a}) \wedge (b = \overline{b})]$.  Because  [(a = \overline{a}) \wedge (b = \overline{b})]$.  Because
1376  $a/b = \overline{a}/\overline{b}$, we denote both of these  $a/b = \overline{a}/\overline{b}$, we denote both of these
1377  numbers simply as $a/b$.  numbers simply as $a/b$.
1378    
1379  By (\ref{eq:ccfr0:scrn0:11a}),  By (\ref{eq:ccfr0:scrn0:11a}),
1380  $a = a_0 b + r_0 = \overline{a_0} b + \overline{r_0}$,  $a = a_0 b + r_0 = \overline{a_0} b + \overline{r_0}$,
1381  $0 < r_0, \overline{r_0} < b$.  Because  $0 < r_0, \overline{r_0} < b$.  Because
1382  $r_0, \overline{r_0} < b$, there is only one combination  $r_0, \overline{r_0} < b$, there is only one combination
1383  of $a_0$ and $r_0$ or of $\overline{a_0}$ and  of $a_0$ and $r_0$ or of $\overline{a_0}$ and
1384  $\overline{r_0}$ that can result in $a$.  Thus, we can conclude  $\overline{r_0}$ that can result in $a$.  Thus, we can conclude
1385  that $a_0 = \overline{a_0}$ and  that $a_0 = \overline{a_0}$ and
1386  $r_0 = \overline{r_0}$.  This type of reasoning, can be  $r_0 = \overline{r_0}$.  This type of reasoning, can be
1387  carried ``downward'' inductively, each time fixing  carried ``downward'' inductively, each time fixing
1388  $a_{i}$ and $r_{i}$.  Finally, we must conclude  $a_{i}$ and $r_{i}$.  Finally, we must conclude
1389  that $(a/b = \overline{a}/\overline{b}) \vworkhimp %  that $(a/b = \overline{a}/\overline{b}) \vworkhimp %
1390  [a_0; a_1, \ldots{} , a_m] = %  [a_0; a_1, \ldots{} , a_m] = %
1391  [\overline{a_0}; \overline{a_1}, \ldots{} , \overline{a_n}]$  [\overline{a_0}; \overline{a_1}, \ldots{} , \overline{a_n}]$
1392  and that $m=n$.    and that $m=n$.  
1393  \end{vworklemmaproof}  \end{vworklemmaproof}
1394  \begin{vworklemmaparsection}{Remarks}  \begin{vworklemmaparsection}{Remarks}
1395  The case of $a_n=1$, $n>0$ deserves further discussion.  The case of $a_n=1$, $n>0$ deserves further discussion.
1396  Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction} will produce  Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction} will produce
1397  an irreducible rational number even if  an irreducible rational number even if
1398  $a_n = 1$, $n>0$.  How is it that uniqueness of representation can  $a_n = 1$, $n>0$.  How is it that uniqueness of representation can
1399  be claimed when clearly, for example, $[2;3,4,2]$ and $[2;3,4,1,1]$  be claimed when clearly, for example, $[2;3,4,2]$ and $[2;3,4,1,1]$
1400  are the same number?  The answer is that $a_n = 1$, $n>0$ requires  are the same number?  The answer is that $a_n = 1$, $n>0$ requires
1401  that $r_{n-2}=r_{n-1}=1$, which violates the ``uniqueness'' assumption  that $r_{n-2}=r_{n-1}=1$, which violates the ``uniqueness'' assumption
1402  used in fixing $a_i$ and $r_i$ in the proof above---specifically note  used in fixing $a_i$ and $r_i$ in the proof above---specifically note
1403  that the condition $0<r_{n-1}<r_{n-2}$ in (\ref{eq:ccfr0:scrn0:11d})  that the condition $0<r_{n-1}<r_{n-2}$ in (\ref{eq:ccfr0:scrn0:11d})
1404  is violated.  If one is allowed to violate the required  is violated.  If one is allowed to violate the required
1405  ever-decreasing remainders, then $a_i$ and $r_i$ cannot  ever-decreasing remainders, then $a_i$ and $r_i$ cannot
1406  be uniquely fixed at each step of the proof, above.  be uniquely fixed at each step of the proof, above.
1407  \end{vworklemmaparsection}  \end{vworklemmaparsection}
1408  \vworklemmafooter{}  \vworklemmafooter{}
1409    
1410  \index{continued fraction!intermediate fraction}  \index{continued fraction!intermediate fraction}
1411  An \emph{intermediate fraction} is a fraction represented  An \emph{intermediate fraction} is a fraction represented
1412  by the continued fraction representation of a $k$-th order  by the continued fraction representation of a $k$-th order
1413  convergent with the final partial quotient $a_k$ reduced  convergent with the final partial quotient $a_k$ reduced
1414  (this can naturally only be done when $a_k > 1$).  As Khinchin  (this can naturally only be done when $a_k > 1$).  As Khinchin
1415  points out (\cite{bibref:b:KhinchinClassic}, p. 14):  points out (\cite{bibref:b:KhinchinClassic}, p. 14):
1416  ``\emph{In arithmetic applications, these intermediate  ``\emph{In arithmetic applications, these intermediate
1417  fractions play an important role (though not as important  fractions play an important role (though not as important
1418  a role as the convergents)}''.  a role as the convergents)}''.
1419    
1420  The intermediate fractions (of a $k$-th order convergent)  The intermediate fractions (of a $k$-th order convergent)
1421  form a monotonically increasing or decreasing sequence of  form a monotonically increasing or decreasing sequence of
1422  fractions (\cite{bibref:b:KhinchinClassic}, p. 13):  fractions (\cite{bibref:b:KhinchinClassic}, p. 13):
1423    
1424  \begin{equation}  \begin{equation}
1425  \label{eq:ccfr0:scrn0:intermediatefrac01}  \label{eq:ccfr0:scrn0:intermediatefrac01}
1426  \frac{p_{k-2}}{q_{k-2}},  \frac{p_{k-2}}{q_{k-2}},
1427  \frac{p_{k-2} + p_{k-1}}{q_{k-2} + q_{k-1}},  \frac{p_{k-2} + p_{k-1}}{q_{k-2} + q_{k-1}},
1428  \frac{p_{k-2} + 2 p_{k-1}}{q_{k-2} + 2 q_{k-1}},  \frac{p_{k-2} + 2 p_{k-1}}{q_{k-2} + 2 q_{k-1}},
1429  \ldots{} ,  \ldots{} ,
1430  \frac{p_{k-2} + a_k p_{k-1}}{q_{k-2} + a_k q_{k-1}}  \frac{p_{k-2} + a_k p_{k-1}}{q_{k-2} + a_k q_{k-1}}
1431  =  =
1432  \frac{p_k}{q_k} .  \frac{p_k}{q_k} .
1433  \end{equation}  \end{equation}
1434    
1435  Note in (\ref{eq:ccfr0:scrn0:intermediatefrac01}) that the  Note in (\ref{eq:ccfr0:scrn0:intermediatefrac01}) that the
1436  first and last fractions are not intermediate fractions (rather, they are  first and last fractions are not intermediate fractions (rather, they are
1437  convergents).  convergents).
1438    
1439  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1440  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1441  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1442  \section{Euclid's GCD Algorithm}  \section{Euclid's GCD Algorithm}
1443  %Section tag: EGA0  %Section tag: EGA0
1444  \index{Euclid!GCD algorithm}  \index{Euclid!GCD algorithm}
1445    
1446  The apparatus of continued fractions is closely related to Euclid's GCD  The apparatus of continued fractions is closely related to Euclid's GCD
1447  algorithm (in fact, historically, Euclid's GCD algorithm is considered  algorithm (in fact, historically, Euclid's GCD algorithm is considered
1448  a precursor of continued fractions).  It was noted in  a precursor of continued fractions).  It was noted in
1449  Lemma \ref{lem:ccfr0:scrn0:aoverbneednotbeirreducible} that the last non-zero  Lemma \ref{lem:ccfr0:scrn0:aoverbneednotbeirreducible} that the last non-zero
1450  remainder when Algorithm \ref{alg:ccfr0:scrn0:akgenalg} is applied  remainder when Algorithm \ref{alg:ccfr0:scrn0:akgenalg} is applied
1451  is the greatest common divisor of $a$ and $b$.  In this section, we  is the greatest common divisor of $a$ and $b$.  In this section, we
1452  present Euclid's algorithm, prove it, and show it similarity to  present Euclid's algorithm, prove it, and show it similarity to
1453  Algorithm \ref{alg:ccfr0:scrn0:akgenalg}.  Algorithm \ref{alg:ccfr0:scrn0:akgenalg}.
1454    
1455  Knuth (\cite{bibref:b:knuthclassic2ndedvol2}, p. 335) presents some background  Knuth (\cite{bibref:b:knuthclassic2ndedvol2}, p. 335) presents some background
1456  information about Euclid's GCD algorithm:  information about Euclid's GCD algorithm:
1457    
1458  \begin{quote}  \begin{quote}
1459  Euclid's algorithm is found in Book 7, Propositions 1 and 2 of his  Euclid's algorithm is found in Book 7, Propositions 1 and 2 of his
1460  \emph{Elements} (c. 300 B.C.), but it probably wasn't his own  \emph{Elements} (c. 300 B.C.), but it probably wasn't his own
1461  invention.  Some scholars believe that the method was known up to  invention.  Some scholars believe that the method was known up to
1462  200 years earlier, at least in its subtractive form, and it  200 years earlier, at least in its subtractive form, and it
1463  was almost certainly known to Eudoxus (c. 375 B.C.); see  was almost certainly known to Eudoxus (c. 375 B.C.); see
1464  K. von Fritz, \emph{Ann. Math.} (2) \textbf{46} 1945, 242-264.  K. von Fritz, \emph{Ann. Math.} (2) \textbf{46} 1945, 242-264.
1465  Aristotle (c. 330 B.C.) hinted at it in his \emph{Topics}, 158b,  Aristotle (c. 330 B.C.) hinted at it in his \emph{Topics}, 158b,
1466  29-35.  However, very little hard evidence about such early history  29-35.  However, very little hard evidence about such early history
1467  has survived [see. W. R. Knorr, \emph{The Evolution of the Euclidian  has survived [see. W. R. Knorr, \emph{The Evolution of the Euclidian
1468  Elements} (Dordrecht:  1975)].  Elements} (Dordrecht:  1975)].
1469    
1470  We might call Euclid's method the granddaddy of all algorithms, because  We might call Euclid's method the granddaddy of all algorithms, because
1471  it is the oldest nontrivial algorithm that has survived to the present day.  it is the oldest nontrivial algorithm that has survived to the present day.
1472  (The chief rival for this honor is perhaps the ancient Egyptian method  (The chief rival for this honor is perhaps the ancient Egyptian method
1473  for multiplication, which was based on doubling and adding, and which forms  for multiplication, which was based on doubling and adding, and which forms
1474  the basis for efficient calculation of \emph{n}th powers as explained  the basis for efficient calculation of \emph{n}th powers as explained
1475  in section 4.6.3.  \ldots{})  in section 4.6.3.  \ldots{})
1476  \end{quote}  \end{quote}
1477    
1478  \begin{vworkalgorithmstatementpar}  \begin{vworkalgorithmstatementpar}
1479     {Euclid's GCD Algorithm For Greatest Common Divisor Of Positive     {Euclid's GCD Algorithm For Greatest Common Divisor Of Positive
1480     Integers \mbox{\boldmath $a$}     Integers \mbox{\boldmath $a$}
1481     And \mbox{\boldmath $b$}}\hspace{-0.4em}\footnote{Knuth     And \mbox{\boldmath $b$}}\hspace{-0.4em}\footnote{Knuth
1482  (\cite{bibref:b:knuthclassic2ndedvol2}, pp. 336-337) distinguishes between the \emph{original}  (\cite{bibref:b:knuthclassic2ndedvol2}, pp. 336-337) distinguishes between the \emph{original}
1483  Euclidian algorithm and the \emph{modern} Euclidian algorithm.  The algorithm presented here  Euclidian algorithm and the \emph{modern} Euclidian algorithm.  The algorithm presented here
1484  is more closely patterned after the \emph{modern} Euclidian algorithm.}  is more closely patterned after the \emph{modern} Euclidian algorithm.}
1485  \label{alg:ccfr0:sega0:euclidsgcdalgorithm}  \label{alg:ccfr0:sega0:euclidsgcdalgorithm}
1486  \begin{alglvl0}  \begin{alglvl0}
1487  \item If ($a < b$), swap $a$ and $b$.\footnote{This step isn't strictly necessary, but is usually done  \item If ($a < b$), swap $a$ and $b$.\footnote{This step isn't strictly necessary, but is usually done
1488        to save one iteration.}        to save one iteration.}
1489  \item Repeat  \item Repeat
1490     \begin{alglvl1}     \begin{alglvl1}
1491     \item $r := a \; mod \; b$.     \item $r := a \; mod \; b$.
1492     \item If ($r = 0$), STOP.     \item If ($r = 0$), STOP.
1493     \item $a := b$.     \item $a := b$.
1494     \item $b := r$.     \item $b := r$.
1495     \end{alglvl1}     \end{alglvl1}
1496  \item \textbf{Exit condition:} $b$ will be the g.c.d. of $a$ and $b$.  \item \textbf{Exit condition:} $b$ will be the g.c.d. of $a$ and $b$.
1497  \end{alglvl0}  \end{alglvl0}
1498  \end{vworkalgorithmstatementpar}  \end{vworkalgorithmstatementpar}
1499  \begin{vworkalgorithmproof}  \begin{vworkalgorithmproof}
1500  Olds (\cite{bibref:b:OldsClassic}, pp. 16-17) shows the  Olds (\cite{bibref:b:OldsClassic}, pp. 16-17) shows the
1501  relationship between Algorithm  relationship between Algorithm
1502  \ref{alg:ccfr0:scrn0:akgenalg} and Euclid's algorithm, and presents  \ref{alg:ccfr0:scrn0:akgenalg} and Euclid's algorithm, and presents
1503  a proof, which is reproduced nearly verbatim here.  a proof, which is reproduced nearly verbatim here.
1504    
1505  First, note that $d$ is the GCD of $a$ and $b$ iff:  First, note that $d$ is the GCD of $a$ and $b$ iff:
1506    
1507  \begin{itemize}  \begin{itemize}
1508  \item (Necessary Condition I) $d$ divides both $a$ and $b$, and  \item (Necessary Condition I) $d$ divides both $a$ and $b$, and
1509  \item (Necessary Condition II) any common divisor $c$ of $a$ and $b$ divides $d$.  \item (Necessary Condition II) any common divisor $c$ of $a$ and $b$ divides $d$.
1510  \end{itemize}  \end{itemize}
1511    
1512  Essentially, we will prove that the final non-zero remainder  Essentially, we will prove that the final non-zero remainder
1513  when the algorithm is applied meets the two criteria above,  when the algorithm is applied meets the two criteria above,
1514  and hence must be the GCD of $a$ and $b$.  and hence must be the GCD of $a$ and $b$.
1515    
1516  Note that (\ref{eq:ccfr0:scrn0:00a}) through  Note that (\ref{eq:ccfr0:scrn0:00a}) through
1517  (\ref{eq:ccfr0:scrn0:00e}) can be rewritten as  (\ref{eq:ccfr0:scrn0:00e}) can be rewritten as
1518  (\ref{eq:ccfr0:scrn0:11a}) through  (\ref{eq:ccfr0:scrn0:11a}) through
1519  (\ref{eq:ccfr0:scrn0:11e}), which make them  (\ref{eq:ccfr0:scrn0:11e}), which make them
1520  consistent with the form Olds' presents.  consistent with the form Olds' presents.
1521    
1522  \begin{eqnarray}  \begin{eqnarray}
1523  \label{eq:ccfr0:scrn0:11a}  \label{eq:ccfr0:scrn0:11a}
1524  a   = a_0 b   +   r_0, && 0 < r_0 < b                          \\  a   = a_0 b   +   r_0, && 0 < r_0 < b                          \\
1525  \label{eq:ccfr0:scrn0:11b}  \label{eq:ccfr0:scrn0:11b}
1526  b   = a_1 r_0 +   r_1, && 0 < r_1 < r_0                        \\  b   = a_1 r_0 +   r_1, && 0 < r_1 < r_0                        \\
1527  \label{eq:ccfr0:scrn0:11c}  \label{eq:ccfr0:scrn0:11c}
1528  r_0 = a_2 r_1 +   r_2, && 0 < r_2 < r_1                        \\  r_0 = a_2 r_1 +   r_2, && 0 < r_2 < r_1                        \\
1529  \ldots{}\hspace{-1.67em}&&                     \nonumber       \\  \ldots{}\hspace{-1.67em}&&                     \nonumber       \\
1530  \label{eq:ccfr0:scrn0:11d}  \label{eq:ccfr0:scrn0:11d}
1531  r_{n-3} = a_{n-1} r_{n-2} + r_{n-1}, && 0 < r_{n-1} < r_{n-2}  \\  r_{n-3} = a_{n-1} r_{n-2} + r_{n-1}, && 0 < r_{n-1} < r_{n-2}  \\
1532  \label{eq:ccfr0:scrn0:11e}  \label{eq:ccfr0:scrn0:11e}
1533  r_{n-2} = a_n     r_{n-1} + 0,       && 0 = r_n  r_{n-2} = a_n     r_{n-1} + 0,       && 0 = r_n
1534  \end{eqnarray}  \end{eqnarray}
1535    
1536  First, we will show that \emph{Necessary Condition I}, above, is met.  First, we will show that \emph{Necessary Condition I}, above, is met.
1537  Note from (\ref{eq:ccfr0:scrn0:11e}) that $r_{n-1} \vworkdivides r_{n-2}$,  Note from (\ref{eq:ccfr0:scrn0:11e}) that $r_{n-1} \vworkdivides r_{n-2}$,
1538  since $r_{n-2}$ is an integer multiple of $r_{n-1}$.  Note from  since $r_{n-2}$ is an integer multiple of $r_{n-1}$.  Note from
1539  (\ref{eq:ccfr0:scrn0:11d}) that $r_{n-1} \vworkdivides r_{n-3}$, since  (\ref{eq:ccfr0:scrn0:11d}) that $r_{n-1} \vworkdivides r_{n-3}$, since
1540  $r_{n-3}$ is also an integer multiple of $r_{n-1}$.  This logic can  $r_{n-3}$ is also an integer multiple of $r_{n-1}$.  This logic can
1541  be carried ``upward'' in the set of equations represented  be carried ``upward'' in the set of equations represented
1542  by (\ref{eq:ccfr0:scrn0:11a}) through (\ref{eq:ccfr0:scrn0:11e}),  by (\ref{eq:ccfr0:scrn0:11a}) through (\ref{eq:ccfr0:scrn0:11e}),
1543  and we can finally conclude that $r_{n-1} \vworkdivides b$ and  and we can finally conclude that $r_{n-1} \vworkdivides b$ and
1544  $r_{n-1} \vworkdivides a$.  This proves \emph{Necessary Condition I}.  $r_{n-1} \vworkdivides a$.  This proves \emph{Necessary Condition I}.
1545    
1546  Second, we will show that \emph{Necessary Condition II}, above, is met.  Second, we will show that \emph{Necessary Condition II}, above, is met.
1547  This time, in (\ref{eq:ccfr0:scrn0:11a}) through (\ref{eq:ccfr0:scrn0:11e}),  This time, in (\ref{eq:ccfr0:scrn0:11a}) through (\ref{eq:ccfr0:scrn0:11e}),
1548  we work top-down rather than bottom-up.  Assume that $c$ is a divisor  we work top-down rather than bottom-up.  Assume that $c$ is a divisor
1549  of $a$ and a divisor of $b$.  Then, from the form of (\ref{eq:ccfr0:scrn0:11a}),  of $a$ and a divisor of $b$.  Then, from the form of (\ref{eq:ccfr0:scrn0:11a}),
1550  $c$ divides $r_0$.\footnote{This implication may be counterintuitive  $c$ divides $r_0$.\footnote{This implication may be counterintuitive
1551  at first glance.  It concerns "reachability" of linear combinations  at first glance.  It concerns "reachability" of linear combinations
1552  of integers with a common divisor.  Specifically, if  of integers with a common divisor.  Specifically, if
1553  $a$ and $b$ have a common divisor $c$, any linear combination  $a$ and $b$ have a common divisor $c$, any linear combination
1554  $ia + jb$, ($i,j \in \vworkintset$),  can ``reach'' only multiples of $c$.  $ia + jb$, ($i,j \in \vworkintset$),  can ``reach'' only multiples of $c$.
1555  In (\ref{eq:ccfr0:scrn0:11a}), $(1)(a)+(-a_0)(b)=r_0$, thus  In (\ref{eq:ccfr0:scrn0:11a}), $(1)(a)+(-a_0)(b)=r_0$, thus
1556  $r_0$ must be a multiple of $c$.  An identical argument applies for  $r_0$ must be a multiple of $c$.  An identical argument applies for
1557  (\ref{eq:ccfr0:scrn0:11a}) through (\ref{eq:ccfr0:scrn0:11e}).}  (\ref{eq:ccfr0:scrn0:11a}) through (\ref{eq:ccfr0:scrn0:11e}).}
1558  Similarly, from the form of (\ref{eq:ccfr0:scrn0:11b}),  Similarly, from the form of (\ref{eq:ccfr0:scrn0:11b}),
1559  $c$ divides $r_1$.  This rationale can be carried ``downward'' to finally  $c$ divides $r_1$.  This rationale can be carried ``downward'' to finally
1560  conclude that $c$ divides $r_{n-1}$.  Thus,  conclude that $c$ divides $r_{n-1}$.  Thus,
1561  $(c \vworkdivides a) \wedge (c \vworkdivides b) \vworkhimp (c \vworkdivides r_{n-1})$,  $(c \vworkdivides a) \wedge (c \vworkdivides b) \vworkhimp (c \vworkdivides r_{n-1})$,
1562  where $r_{n-1}$ is the last non-zero remainder.  This proves  where $r_{n-1}$ is the last non-zero remainder.  This proves
1563  \emph{Necessary Condition II}.  \emph{Necessary Condition II}.
1564    
1565  Thus, $r_{n-1}$ is the GCD of $a$ and $b$.  Thus, $r_{n-1}$ is the GCD of $a$ and $b$.
1566  \end{vworkalgorithmproof}  \end{vworkalgorithmproof}
1567  \begin{vworkalgorithmparsection}{Remarks}  \begin{vworkalgorithmparsection}{Remarks}
1568  It is easy to observe that the only difference between  It is easy to observe that the only difference between
1569  Algorithm \ref{alg:ccfr0:scrn0:akgenalg} and  Algorithm \ref{alg:ccfr0:scrn0:akgenalg} and
1570  Algorithm \ref{alg:ccfr0:sega0:euclidsgcdalgorithm} is  Algorithm \ref{alg:ccfr0:sega0:euclidsgcdalgorithm} is
1571  that Algorithm \ref{alg:ccfr0:scrn0:akgenalg} records the  that Algorithm \ref{alg:ccfr0:scrn0:akgenalg} records the
1572  quotient of each division, whereas  quotient of each division, whereas
1573  Algorithm \ref{alg:ccfr0:sega0:euclidsgcdalgorithm}  Algorithm \ref{alg:ccfr0:sega0:euclidsgcdalgorithm}
1574  does not.  does not.
1575  \end{vworkalgorithmparsection}  \end{vworkalgorithmparsection}
1576  %\vworkalgorithmfooter{}  %\vworkalgorithmfooter{}
1577    
1578  \begin{vworkexamplestatement}  \begin{vworkexamplestatement}
1579  \label{ex:ccfr0:sega0:01}  \label{ex:ccfr0:sega0:01}
1580  Use Euclid's algorithm to find the greatest common divisor  Use Euclid's algorithm to find the greatest common divisor
1581  of 1,736,651 and 26,023.  of 1,736,651 and 26,023.
1582  \end{vworkexamplestatement}  \end{vworkexamplestatement}
1583  \begin{vworkexampleparsection}{Solution}  \begin{vworkexampleparsection}{Solution}
1584  \begin{table}  \begin{table}
1585  \caption{Euclid's Algorithm Applied To Find Greatest Common Divisor Of 1,736,651 and 26,023  \caption{Euclid's Algorithm Applied To Find Greatest Common Divisor Of 1,736,651 and 26,023
1586           (Example \ref{ex:ccfr0:sega0:01})}           (Example \ref{ex:ccfr0:sega0:01})}
1587  \label{tbl:ex:ccfr0:sega0:01}  \label{tbl:ex:ccfr0:sega0:01}
1588  \begin{center}  \begin{center}
1589  \begin{tabular}{|c|c|c|c|}  \begin{tabular}{|c|c|c|c|}
1590  \hline  \hline
1591  \small{Iteration} & \small{$a$}  & \small{$b$} & \small{$r : = a \; mod \; b$}        \\  \small{Iteration} & \small{$a$}  & \small{$b$} & \small{$r : = a \; mod \; b$}        \\
1592  \hline  \hline
1593  \hline  \hline
1594  \small{1}    & \small{1,736,651}           & \small{26,023}          & \small{19,133} \\  \small{1}    & \small{1,736,651}           & \small{26,023}          & \small{19,133} \\
1595  \hline  \hline
1596  \small{2}    &    \small{26,023}           & \small{19,133}          &  \small{6,890} \\  \small{2}    &    \small{26,023}           & \small{19,133}          &  \small{6,890} \\
1597  \hline  \hline
1598  \small{3}    &    \small{19,133}           &  \small{6,890}          &  \small{5,353} \\  \small{3}    &    \small{19,133}           &  \small{6,890}          &  \small{5,353} \\
1599  \hline  \hline
1600  \small{4}    &     \small{6,890}           &  \small{5,353}          &  \small{1,537} \\  \small{4}    &     \small{6,890}           &  \small{5,353}          &  \small{1,537} \\
1601  \hline  \hline
1602  \small{5}    &     \small{5,353}           &  \small{1,537}          &    \small{742} \\  \small{5}    &     \small{5,353}           &  \small{1,537}          &    \small{742} \\
1603  \hline  \hline
1604  \small{6}    &     \small{1,537}           &    \small{742}          &     \small{53} \\  \small{6}    &     \small{1,537}           &    \small{742}          &     \small{53} \\
1605  \hline  \hline
1606  \small{7}    &       \small{742}           &     \small{53}          &      \small{0} \\  \small{7}    &       \small{742}           &     \small{53}          &      \small{0} \\
1607  \hline  \hline
1608  \end{tabular}  \end{tabular}
1609  \end{center}  \end{center}
1610  \end{table}  \end{table}
1611  Table \ref{tbl:ex:ccfr0:sega0:01} shows the application of  Table \ref{tbl:ex:ccfr0:sega0:01} shows the application of
1612  Algorithm \ref{alg:ccfr0:sega0:euclidsgcdalgorithm} (Euclid's  Algorithm \ref{alg:ccfr0:sega0:euclidsgcdalgorithm} (Euclid's
1613  GCD algorithm) to find the greatest common divisor  GCD algorithm) to find the greatest common divisor
1614  of 1,736,651 and 26,023.  The last non-zero remainder (and hence  of 1,736,651 and 26,023.  The last non-zero remainder (and hence
1615  the greatest common divisor) is 53.  the greatest common divisor) is 53.
1616  \end{vworkexampleparsection}  \end{vworkexampleparsection}
1617  \begin{vworkexampleparsection}{Remarks}  \begin{vworkexampleparsection}{Remarks}
1618  The prime factorization of 1,736,651 is $151 \times 53 \times 31 \times 7$, and  The prime factorization of 1,736,651 is $151 \times 53 \times 31 \times 7$, and
1619  the prime factorization of 26,023 is $491 \times 53$, which is consistent  the prime factorization of 26,023 is $491 \times 53$, which is consistent
1620  with the result in Table \ref{tbl:ex:ccfr0:sega0:01}.  with the result in Table \ref{tbl:ex:ccfr0:sega0:01}.
1621  \end{vworkexampleparsection}  \end{vworkexampleparsection}
1622  \vworkexamplefooter{}  \vworkexamplefooter{}
1623    
1624    
1625  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1626  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1627  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1628  \section[CF Representation Of Irrationals]  \section[CF Representation Of Irrationals]
1629          {Continued Fraction Representation Of Irrational Numbers}          {Continued Fraction Representation Of Irrational Numbers}
1630  %Section tag:  CIN0  %Section tag:  CIN0
1631  \label{ccfr0:scin0}  \label{ccfr0:scin0}
1632    
1633  \index{continued fraction!irrational numbers@of irrational numbers}  \index{continued fraction!irrational numbers@of irrational numbers}
1634  \index{irrational number!continued fraction representation of}Irrational  \index{irrational number!continued fraction representation of}Irrational
1635  numbers (such as $\sqrt{2}$ or $\pi$) necessarily have infinite continued  numbers (such as $\sqrt{2}$ or $\pi$) necessarily have infinite continued
1636  fraction representations (i.e. the representations do not terminate).  This is clear, since  fraction representations (i.e. the representations do not terminate).  This is clear, since
1637  Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction} gives a concrete procedure  Theorem \ref{thm:ccfr0:scnv0:canonicalconvergentconstruction} gives a concrete procedure
1638  for constructing a rational number from any \emph{finite} continued fraction;  for constructing a rational number from any \emph{finite} continued fraction;
1639  therefore a continued fraction corresponding to an irrational number  therefore a continued fraction corresponding to an irrational number
1640  cannot be finite.  cannot be finite.
1641    
1642  The algorithm for determining the partial quotients of an irrational number is  The algorithm for determining the partial quotients of an irrational number is
1643  awkward, because it is a symbolic (rather than a numerical) algorithm.  awkward, because it is a symbolic (rather than a numerical) algorithm.
1644  We present the algorithm here for perspective and completeness, although it  We present the algorithm here for perspective and completeness, although it
1645  is not often useful in practical engineering work.  In practical work, an  is not often useful in practical engineering work.  In practical work, an
1646  ordinary handheld calculator will supply a real number to far more precision  ordinary handheld calculator will supply a real number to far more precision
1647  than necessary, and the displayed real number can be converted to a rational  than necessary, and the displayed real number can be converted to a rational
1648  number for the application of Algorithm \ref{alg:ccfr0:scrn0:akgenalg}.  number for the application of Algorithm \ref{alg:ccfr0:scrn0:akgenalg}.
1649  For practical work, it is rarely necessary to apply a Algorithm  For practical work, it is rarely necessary to apply a Algorithm
1650  \ref{alg:ccfr0:scin0:symboliccfalgorithm}.  \ref{alg:ccfr0:scin0:symboliccfalgorithm}.
1651    
1652  The symbolic algorithm for determining the continued fraction partial quotients  The symbolic algorithm for determining the continued fraction partial quotients
1653  of a real number is a recursive process very similar to the algorithm for  of a real number is a recursive process very similar to the algorithm for
1654  determining the continued fraction partial quotients of a rational number.  determining the continued fraction partial quotients of a rational number.
1655  The essential activity is choosing the largest possible integer $a_i$ in each  The essential activity is choosing the largest possible integer $a_i$ in each
1656  iteration.  iteration.
1657    
1658  Algorithm \ref{alg:ccfr0:scin0:symboliccfalgorithm} begins by choosing  Algorithm \ref{alg:ccfr0:scin0:symboliccfalgorithm} begins by choosing
1659  the largest integer $a_0$ not larger than $x$, then expressing $x$ as  the largest integer $a_0$ not larger than $x$, then expressing $x$ as
1660    
1661  \begin{equation}  \begin{equation}
1662  x = a_0 + \frac{1}{x_1} .  x = a_0 + \frac{1}{x_1} .
1663  \end{equation}  \end{equation}
1664    
1665  \noindent{}With $a_0$ chosen, $x_1$ can then be expressed as  \noindent{}With $a_0$ chosen, $x_1$ can then be expressed as
1666    
1667  \begin{equation}  \begin{equation}
1668  x_1 = \frac{1}{x - a_0} .  x_1 = \frac{1}{x - a_0} .
1669  \end{equation}  \end{equation}
1670    
1671  \noindent{}$x_1$ can then be expressed as  \noindent{}$x_1$ can then be expressed as
1672    
1673  \begin{equation}  \begin{equation}
1674  x_1 = a_1 + \frac{1}{x_2} ,  x_1 = a_1 + \frac{1}{x_2} ,
1675  \end{equation}  \end{equation}
1676    
1677  \noindent{}and $a_1$, the largest integer not larger than $x_1$,  \noindent{}and $a_1$, the largest integer not larger than $x_1$,
1678  can be chosen.  can be chosen.
1679  This process can be continued indefinitely (with an irrational $x$, it won't terminate)  This process can be continued indefinitely (with an irrational $x$, it won't terminate)
1680  to determine as many partial quotients as desired.  to determine as many partial quotients as desired.
1681    
1682  \begin{vworkalgorithmstatementpar}  \begin{vworkalgorithmstatementpar}
1683     {Symbolic Algorithm For Obtaining     {Symbolic Algorithm For Obtaining
1684      Continued Fraction Representation Of An Irrational Number      Continued Fraction Representation Of An Irrational Number
1685     \mbox{\boldmath $x$}}     \mbox{\boldmath $x$}}
1686  \label{alg:ccfr0:scin0:symboliccfalgorithm}  \label{alg:ccfr0:scin0:symboliccfalgorithm}
1687  \begin{alglvl0}  \begin{alglvl0}
1688  \item $x_0 := x$ (the real number whose partial quotients are desired).  \item $x_0 := x$ (the real number whose partial quotients are desired).
1689  \item $k := -1$.  \item $k := -1$.
1690  \item Repeat  \item Repeat
1691     \begin{alglvl1}     \begin{alglvl1}
1692     \item $k := k + 1$.     \item $k := k + 1$.
1693     \item $a_k := \lfloor x_k \rfloor$.     \item $a_k := \lfloor x_k \rfloor$.
1694     \item $x_{k+1} := \displaystyle{\frac{1}{x_k - a_k}}$.     \item $x_{k+1} := \displaystyle{\frac{1}{x_k - a_k}}$.
1695     \end{alglvl1}     \end{alglvl1}
1696  \item Until (as many partial quotients as desired are obtained).  \item Until (as many partial quotients as desired are obtained).
1697  \end{alglvl0}  \end{alglvl0}
1698  \end{vworkalgorithmstatementpar}  \end{vworkalgorithmstatementpar}
1699  %\vworkalgorithmfooter{}  %\vworkalgorithmfooter{}
1700    
1701  \begin{vworkexamplestatement}  \begin{vworkexamplestatement}
1702  \label{ex:ccfr0:scin0:symboliccfalgorithmexample}  \label{ex:ccfr0:scin0:symboliccfalgorithmexample}
1703  Find the first several continued fraction partial quotients of $\sqrt{3}$.  Find the first several continued fraction partial quotients of $\sqrt{3}$.
1704  \end{vworkexamplestatement}  \end{vworkexamplestatement}
1705  \begin{vworkexampleparsection}{Solution}  \begin{vworkexampleparsection}{Solution}
1706  Applying Algorithm \ref{alg:ccfr0:scin0:symboliccfalgorithm}:  Applying Algorithm \ref{alg:ccfr0:scin0:symboliccfalgorithm}:
1707    
1708  \begin{equation}  \begin{equation}
1709  x_0 := x = \sqrt{3}  x_0 := x = \sqrt{3}
1710  \end{equation}  \end{equation}
1711    
1712  \begin{equation}  \begin{equation}
1713  k := -1  k := -1
1714  \end{equation}  \end{equation}
1715    
1716  \begin{equation}  \begin{equation}
1717  k := k+1 = 0  k := k+1 = 0
1718  \end{equation}  \end{equation}
1719    
1720  \begin{equation}  \begin{equation}
1721  a_0 := \lfloor x_0 \rfloor = \lfloor \sqrt{3} \rfloor = 1  a_0 := \lfloor x_0 \rfloor = \lfloor \sqrt{3} \rfloor = 1
1722  \end{equation}  \end{equation}
1723    
1724  \begin{equation}  \begin{equation}
1725  x_1 := \frac{1}{x_0 - a_0}  x_1 := \frac{1}{x_0 - a_0}
1726      = \frac{1}{\sqrt{3}-1}      = \frac{1}{\sqrt{3}-1}
1727      = \frac{\sqrt{3}+1}{2}      = \frac{\sqrt{3}+1}{2}
1728  \end{equation}  \end{equation}
1729    
1730  \begin{equation}  \begin{equation}
1731  k := k + 1 = 1  k := k + 1 = 1
1732  \end{equation}  \end{equation}
1733    
1734  \begin{equation}  \begin{equation}
1735  a_1 := \lfloor x_1 \rfloor =  a_1 := \lfloor x_1 \rfloor =
1736  \left\lfloor {\frac{\sqrt{3}+1}{2}} \right\rfloor = 1  \left\lfloor {\frac{\sqrt{3}+1}{2}} \right\rfloor = 1
1737  \end{equation}  \end{equation}
1738    
1739  \begin{equation}  \begin{equation}
1740  x_2 := \frac{1}{x_1 - 1}  x_2 := \frac{1}{x_1 - 1}
1741       = \frac{1}{\frac{\sqrt{3}+1}{2}-1}       = \frac{1}{\frac{\sqrt{3}+1}{2}-1}
1742       = \sqrt{3}+1       = \sqrt{3}+1
1743  \end{equation}  \end{equation}
1744    
1745  \begin{equation}  \begin{equation}
1746  k := k + 1 = 2  k := k + 1 = 2
1747  \end{equation}  \end{equation}
1748    
1749  \begin{equation}  \begin{equation}
1750  a_2 := \lfloor x_2 \rfloor = \lfloor \sqrt{3}+1 \rfloor = 2  a_2 := \lfloor x_2 \rfloor = \lfloor \sqrt{3}+1 \rfloor = 2
1751  \end{equation}  \end{equation}
1752    
1753  \begin{equation}  \begin{equation}
1754  x_3 := \frac{1}{(\sqrt{3}+1)-2} = \frac{\sqrt{3}+1}{2}  x_3 := \frac{1}{(\sqrt{3}+1)-2} = \frac{\sqrt{3}+1}{2}
1755  \end{equation}  \end{equation}
1756    
1757  Note that $x_3 = x_1$, so the algorithm will repeat with  Note that $x_3 = x_1$, so the algorithm will repeat with
1758  $a_3=1$, $a_4=2$, $a_5=1$, $a_6=2$, etc.  Thus, the continued  $a_3=1$, $a_4=2$, $a_5=1$, $a_6=2$, etc.  Thus, the continued
1759  fraction representation of $\sqrt{3}$ is  fraction representation of $\sqrt{3}$ is
1760  $[1;1,2,1,2,1,2, \ldots{}]$ = $[1;\overline{1,2}]$.  $[1;1,2,1,2,1,2, \ldots{}]$ = $[1;\overline{1,2}]$.
1761  \end{vworkexampleparsection}  \end{vworkexampleparsection}
1762  \begin{vworkexampleparsection}{Remarks}  \begin{vworkexampleparsection}{Remarks}
1763  \index{continued fraction!repeating}  \index{continued fraction!repeating}
1764  It can be proved that all continued fractions that repeat or repeat  It can be proved that all continued fractions that repeat or repeat
1765  from some point onward  from some point onward
1766  represent real numbers of the form $\frac{P \pm \sqrt{D}}{Q}$,  represent real numbers of the form $\frac{P \pm \sqrt{D}}{Q}$,
1767  where $D \in \vworkintsetpos$ is not the square of an integer.    where $D \in \vworkintsetpos$ is not the square of an integer.  
1768  It can also be shown  It can also be shown
1769  that all numbers of this form result in continued fractions that  that all numbers of this form result in continued fractions that
1770  repeat or repeat from some point onward.  (See Olds  repeat or repeat from some point onward.  (See Olds
1771  \cite{bibref:b:OldsClassic}, Chapter 4.)  It is beyond the scope  \cite{bibref:b:OldsClassic}, Chapter 4.)  It is beyond the scope
1772  of our interest in continued fractions to develop these properties.  of our interest in continued fractions to develop these properties.
1773  \end{vworkexampleparsection}  \end{vworkexampleparsection}
1774  \vworkexamplefooter{}  \vworkexamplefooter{}
1775    
1776    
1777  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1778  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1779  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1780  \section{Convergents As Best Approximations}  \section{Convergents As Best Approximations}
1781  %Section tag:  CBA0  %Section tag:  CBA0
1782    
1783  Up until this point, we've presented general properties of continued  Up until this point, we've presented general properties of continued
1784  fractions and convergents without regard for practical applications.  fractions and convergents without regard for practical applications.
1785  In this section, we present results and algorithms to use the  In this section, we present results and algorithms to use the
1786  apparatus of continued fractions to obtain best rational approximations.  apparatus of continued fractions to obtain best rational approximations.
1787    
1788  Although we don't dwell on other algorithms for locating best  Although we don't dwell on other algorithms for locating best
1789  rational approximations (we present only the single best  rational approximations (we present only the single best
1790  algorithm), it is worth noting that there are many naive algorithms  algorithm), it is worth noting that there are many naive algorithms
1791  for locating best rational approximations.  These include:  for locating best rational approximations.  These include:
1792    
1793  \begin{itemize}  \begin{itemize}
1794    
1795  \item  Exhaustive search of the integer lattice  \item  Exhaustive search of the integer lattice
1796         [$O(h_{MAX} k_{MAX})$].         [$O(h_{MAX} k_{MAX})$].
1797    
1798  \item  Building the Farey series starting at an  \item  Building the Farey series starting at an
1799         integer [$O(max(h_{MAX}, k_{MAX})^2)$]         integer [$O(max(h_{MAX}, k_{MAX})^2)$]
1800             (see Algorithm \cfryzeroxrefhyphen{}\ref{alg:cfry0:sgfs0:02}).             (see Algorithm \cfryzeroxrefhyphen{}\ref{alg:cfry0:sgfs0:02}).
1801    
1802  \item  Building the Farey series starting at a rational number with  \item  Building the Farey series starting at a rational number with
1803         a large prime denominator [$O(max(h_{MAX}, k_{MAX}))$].         a large prime denominator [$O(max(h_{MAX}, k_{MAX}))$].
1804    
1805  \item  Building the Stern-Brocot tree (see Section \ref{ccfr0:ssbt0})  \item  Building the Stern-Brocot tree (see Section \ref{ccfr0:ssbt0})
1806         [$O(max(h_{MAX}, k_{MAX}))$].         [$O(max(h_{MAX}, k_{MAX}))$].
1807    
1808  \end{itemize}  \end{itemize}
1809    
1810  Although we don't justify it formally,  Although we don't justify it formally,
1811  the continued fraction algorithms presented here are  the continued fraction algorithms presented here are
1812  $O(log \; max(h_{MAX}, k_{MAX}))$.\footnote{Well,  $O(log \; max(h_{MAX}, k_{MAX}))$.\footnote{Well,
1813  not exactly.  In the classical computer science  not exactly.  In the classical computer science
1814  sense (speaking only in terms of number of operations),  sense (speaking only in terms of number of operations),
1815  the algorithms are $O(log \; max(h_{MAX}, k_{MAX}))$.  However,  the algorithms are $O(log \; max(h_{MAX}, k_{MAX}))$.  However,
1816  if $h_{MAX}$ and $k_{MAX}$ are increased beyond the sizes  if $h_{MAX}$ and $k_{MAX}$ are increased beyond the sizes
1817  of integers that a computer can inherently accomodate, one must  of integers that a computer can inherently accomodate, one must
1818  use long integer calculation software, which requires more time for  use long integer calculation software, which requires more time for
1819  each integer operation than is required for machine native  each integer operation than is required for machine native
1820  integer sizes.  As $h_{MAX}$ and $k_{MAX}$ are increased far  integer sizes.  As $h_{MAX}$ and $k_{MAX}$ are increased far
1821  beyond integer sizes accomodated inherently by the computer,  beyond integer sizes accomodated inherently by the computer,
1822  the relationship surely is not $O(log \; max(h_{MAX}, k_{MAX}))$.}    the relationship surely is not $O(log \; max(h_{MAX}, k_{MAX}))$.}  
1823  The basis on which we  The basis on which we
1824  make that assertion is the geometric rate of  make that assertion is the geometric rate of
1825  increase of convergents (see Theorem  increase of convergents (see Theorem
1826  \ref{thm:ccfr0:scnv0:minimumrateofconvergentdenominatorincrease}),  \ref{thm:ccfr0:scnv0:minimumrateofconvergentdenominatorincrease}),
1827  which means that the number of steps required is tied to the  which means that the number of steps required is tied to the
1828  logarithm of the maximum denominator involved, as it is  logarithm of the maximum denominator involved, as it is
1829  necessary to obtain partial quotients and convergents only until  necessary to obtain partial quotients and convergents only until
1830  $q_k \geq max(h_{MAX},k_{MAX})$.  $q_k \geq max(h_{MAX},k_{MAX})$.
1831    
1832  \begin{vworktheoremstatement}  \begin{vworktheoremstatement}
1833  \label{thm:ccfr0:scba0:convergentcloseness}  \label{thm:ccfr0:scba0:convergentcloseness}
1834  In the case of an infinite continued fraction for $k \geq 0$ or in the  In the case of an infinite continued fraction for $k \geq 0$ or in the
1835  case of a finite continued fraction for $0 \leq k < n-1$, a convergent  case of a finite continued fraction for $0 \leq k < n-1$, a convergent
1836  $s_k = p_k/q_k$ to a [rational or irrational] number  $s_k = p_k/q_k$ to a [rational or irrational] number
1837  $\alpha \in \vworkrealsetnonneg$ satisfies  $\alpha \in \vworkrealsetnonneg$ satisfies
1838    
1839  \begin{equation}  \begin{equation}
1840  \left| {\alpha - \frac{p_k}{q_k}} \right|  \left| {\alpha - \frac{p_k}{q_k}} \right|
1841  <  <
1842  \frac{1}{q_k q_{k+1}} .  \frac{1}{q_k q_{k+1}} .
1843  \end{equation}  \end{equation}
1844    
1845  In the case of a finite continued fraction with $k = n-1$,  In the case of a finite continued fraction with $k = n-1$,
1846    
1847  \begin{equation}  \begin{equation}
1848  \left| {\alpha - \frac{p_k}{q_k}} \right|  \left| {\alpha - \frac{p_k}{q_k}} \right|
1849  =  =
1850  \frac{1}{q_k q_{k+1}} .  \frac{1}{q_k q_{k+1}} .
1851  \end{equation}  \end{equation}
1852  \end{vworktheoremstatement}  \end{vworktheoremstatement}
1853  \begin{vworktheoremproof}  \begin{vworktheoremproof}
1854  The proof comes directly from Theorem  The proof comes directly from Theorem
1855  \ref{thm:ccfr0:scnv0:crossproductminusone} (Corollary I)  \ref{thm:ccfr0:scnv0:crossproductminusone} (Corollary I)
1856  and Theorem  and Theorem
1857  \ref{thm:ccfr0:scnv0:evenslessthanoddsgreaterthan}.  \ref{thm:ccfr0:scnv0:evenslessthanoddsgreaterthan}.
1858  \end{vworktheoremproof}  \end{vworktheoremproof}
1859  \begin{vworktheoremparsection}{Remarks}  \begin{vworktheoremparsection}{Remarks}
1860  Khinchin describes this result (\cite{bibref:b:KhinchinClassic}, p. 9)  Khinchin describes this result (\cite{bibref:b:KhinchinClassic}, p. 9)
1861  as playing a basic role in the arithmetic  as playing a basic role in the arithmetic
1862  applications of continued fractions.  In fact, this theorem is used  applications of continued fractions.  In fact, this theorem is used
1863  in the proof of Theorem  in the proof of Theorem
1864  \ref{thm:ccfr0:scba0:cfenclosingneighbors}.  \ref{thm:ccfr0:scba0:cfenclosingneighbors}.
1865  \end{vworktheoremparsection}  \end{vworktheoremparsection}
1866  \vworktheoremfooter{}  \vworktheoremfooter{}
1867    
1868    
1869  We now present and prove the fundamental theorem of this chapter, which gives an  We now present and prove the fundamental theorem of this chapter, which gives an
1870  $O(log \; N)$ algorithm for finding the enclosing neighbors in $F_N$ to an arbitrary  $O(log \; N)$ algorithm for finding the enclosing neighbors in $F_N$ to an arbitrary
1871  rational number $a/b$.\footnote{\label{footnote:ccfr0:scba0:rationalitynotrequired}Theorem  rational number $a/b$.\footnote{\label{footnote:ccfr0:scba0:rationalitynotrequired}Theorem
1872  \ref{thm:ccfr0:scba0:cfenclosingneighbors}  \ref{thm:ccfr0:scba0:cfenclosingneighbors}
1873  applies to irrational numbers as well,  applies to irrational numbers as well,
1874  so long as one can obtain enough partial quotients, but we don't highlight this  so long as one can obtain enough partial quotients, but we don't highlight this
1875  fact because it is rare in engineering applications that one uses symbolic methods  fact because it is rare in engineering applications that one uses symbolic methods
1876  to obtain best rational approximations.  to obtain best rational approximations.
1877  As emphasized by (\ref{eq:ccfr0:spar0:01}), (\ref{eq:ccfr0:spar0:02}), and  As emphasized by (\ref{eq:ccfr0:spar0:01}), (\ref{eq:ccfr0:spar0:02}), and
1878  (\ref{eq:ccfr0:spar0:03}),  (\ref{eq:ccfr0:spar0:03}),
1879  the process of obtaining partial quotients is essentially a process of determining in which  the process of obtaining partial quotients is essentially a process of determining in which
1880  partition a number lies.  All numbers in the same partition---rational or  partition a number lies.  All numbers in the same partition---rational or
1881  irrational---have the same Farey neighbors in all Farey series up to a certain order.  irrational---have the same Farey neighbors in all Farey series up to a certain order.
1882  If the partial quotients of  If the partial quotients of
1883  an irrational number can be obtained up through $a_k$ s.t. $s_k = p_k/q_k$ is the  an irrational number can be obtained up through $a_k$ s.t. $s_k = p_k/q_k$ is the
1884  highest-order convergent with $q_k \leq N$, then this theorem can be applied.  highest-order convergent with $q_k \leq N$, then this theorem can be applied.
1885  Knowledge of all $a_0, \ldots{} , a_k$ is equivalent  Knowledge of all $a_0, \ldots{} , a_k$ is equivalent
1886  to the knowledge that the number is in a partition where all numbers in that partition have  to the knowledge that the number is in a partition where all numbers in that partition have
1887  the same Farey neighbors in all Farey series up through at least order $q_k$.}  the same Farey neighbors in all Farey series up through at least order $q_k$.}
1888    
1889    
1890  \begin{vworktheoremstatementpar}{Enclosing Neighbors Of \mbox{\boldmath $x \notin F_N$}  \begin{vworktheoremstatementpar}{Enclosing Neighbors Of \mbox{\boldmath $x \notin F_N$}
1891                                   In \mbox{\boldmath $F_N$}}                                   In \mbox{\boldmath $F_N$}}
1892  \label{thm:ccfr0:scba0:cfenclosingneighbors}  \label{thm:ccfr0:scba0:cfenclosingneighbors}
1893  For a non-negative rational  For a non-negative rational
1894  number $a/b$ not in  number $a/b$ not in
1895  $F_N$ which has a  $F_N$ which has a
1896  continued fraction representation  continued fraction representation
1897  $[a_0;a_1,a_2,\ldots{} ,a_n]$, the  $[a_0;a_1,a_2,\ldots{} ,a_n]$, the
1898  highest-order convergent $s_k = p_k/q_k$ with $q_k \leq N$ is one  highest-order convergent $s_k = p_k/q_k$ with $q_k \leq N$ is one
1899  neighbor\footnote{By neighbors in $F_N$ we mean the rational numbers  neighbor\footnote{By neighbors in $F_N$ we mean the rational numbers
1900  in $F_N$ immediately to the left and immediately to the right  in $F_N$ immediately to the left and immediately to the right
1901  of $a/b$.}  of $a/b$.}
1902  to $a/b$ in $F_N$, and the other neighbor in  to $a/b$ in $F_N$, and the other neighbor in
1903  $F_N$ is\footnote{Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}  $F_N$ is\footnote{Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}
1904  is a somewhat stronger statement about best approximations  is a somewhat stronger statement about best approximations
1905  than Khinchin makes in \cite{bibref:b:KhinchinClassic}, Theorem 15.  than Khinchin makes in \cite{bibref:b:KhinchinClassic}, Theorem 15.
1906  We were not able to locate  We were not able to locate
1907  this theorem or a proof in print,  this theorem or a proof in print,
1908  but this theorem is understood within the number theory community.  but this theorem is understood within the number theory community.
1909  It appears on the Web  It appears on the Web
1910  page of David Eppstein \cite{bibref:i:davideppstein} in the form of a  page of David Eppstein \cite{bibref:i:davideppstein} in the form of a
1911  `C'-language computer program,  `C'-language computer program,
1912  \texttt{http://www.ics.uci.edu/\~{}{}eppstein/numth/frap.c}.  \texttt{http://www.ics.uci.edu/\~{}{}eppstein/numth/frap.c}.
1913  Although  Although
1914  Dr. Eppstein phrases the solution in terms of modifying  Dr. Eppstein phrases the solution in terms of modifying
1915  a partial quotient, his approach is equivalent to  a partial quotient, his approach is equivalent to
1916  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).}  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).}
1917    
1918  \begin{equation}  \begin{equation}
1919  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}
1920  \frac{{\displaystyle{\left\lfloor {\frac{{N - q_{k - 1} }}{{q_k }}} \right\rfloor}  \frac{{\displaystyle{\left\lfloor {\frac{{N - q_{k - 1} }}{{q_k }}} \right\rfloor}
1921   p_k  + p_{k - 1} }}{{\displaystyle{\left\lfloor {\frac{{N - q_{k - 1} }}{{q_k }}}   p_k  + p_{k - 1} }}{{\displaystyle{\left\lfloor {\frac{{N - q_{k - 1} }}{{q_k }}}
1922   \right\rfloor} q_k  + q_{k - 1} }}.   \right\rfloor} q_k  + q_{k - 1} }}.
1923  \end{equation}  \end{equation}
1924  \end{vworktheoremstatementpar}  \end{vworktheoremstatementpar}
1925  \begin{vworktheoremproof}  \begin{vworktheoremproof}
1926  First, it is proved that the highest-order  First, it is proved that the highest-order
1927  convergent $s_k = p_k/q_k$ with $q_k \leq N$ is one of the two  convergent $s_k = p_k/q_k$ with $q_k \leq N$ is one of the two
1928  neighbors to $a/b$ in $F_N$.  $s_k \in F_N$, since $q_k \leq N$.  neighbors to $a/b$ in $F_N$.  $s_k \in F_N$, since $q_k \leq N$.
1929  By Theorem \ref{thm:ccfr0:scba0:convergentcloseness}, the upper bound on the  By Theorem \ref{thm:ccfr0:scba0:convergentcloseness}, the upper bound on the
1930  difference between $a/b$ and arbitrary $s_k$ is given by  difference between $a/b$ and arbitrary $s_k$ is given by
1931    
1932  \begin{equation}  \begin{equation}
1933  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:02}  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:02}
1934  \left| {\frac{a}{b}  - \frac{{p_k }}{{q_k }}} \right| < \frac{1}{{q_k q_{k + 1} }}.  \left| {\frac{a}{b}  - \frac{{p_k }}{{q_k }}} \right| < \frac{1}{{q_k q_{k + 1} }}.
1935  \end{equation}  \end{equation}
1936    
1937  For two consecutive terms in $F_N$, $Kh-Hk=1$  For two consecutive terms in $F_N$, $Kh-Hk=1$
1938  (\cfryzeroxrefcomma{}Theorem \ref{thm:cfry0:spfs:02}).  (\cfryzeroxrefcomma{}Theorem \ref{thm:cfry0:spfs:02}).
1939  For a Farey neighbor $H/K$ to $s_k$ in $F_N$,  For a Farey neighbor $H/K$ to $s_k$ in $F_N$,
1940  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:03}) must hold.  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:03}) must hold.
1941    
1942  \begin{equation}  \begin{equation}
1943  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:03}  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:03}
1944  \frac{1}{q_k N} \leq \left| {\frac{H}{K} - \frac{p_k}{q_k}} \right|  \frac{1}{q_k N} \leq \left| {\frac{H}{K} - \frac{p_k}{q_k}} \right|
1945  \end{equation}  \end{equation}
1946    
1947  $q_{k+1}>N$, because $q_{k+1}>q_k$ and $p_k/q_k$ was chosen to be the  $q_{k+1}>N$, because $q_{k+1}>q_k$ and $p_k/q_k$ was chosen to be the
1948  highest-order convergent with $q_k\leq N$.  Using this knowledge and  highest-order convergent with $q_k\leq N$.  Using this knowledge and
1949  combining (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:02}) and  combining (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:02}) and
1950  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:03}) leads to  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:03}) leads to
1951  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:04}).  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:04}).
1952    
1953  \begin{equation}  \begin{equation}
1954  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:04}  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:04}
1955  \left| {\frac{a}{b}  - \frac{{p_k }}{{q_k }}} \right| < \frac{1}{{q_k q_{k + 1} }}  \left| {\frac{a}{b}  - \frac{{p_k }}{{q_k }}} \right| < \frac{1}{{q_k q_{k + 1} }}
1956  <  <
1957  \frac{1}{q_k N} \leq \left| {\frac{H}{K} - \frac{p_k}{q_k}} \right|  \frac{1}{q_k N} \leq \left| {\frac{H}{K} - \frac{p_k}{q_k}} \right|
1958  \end{equation}  \end{equation}
1959    
1960  This proves that $s_k$ is one neighbor to $a/b$ in $F_N$.  This proves that $s_k$ is one neighbor to $a/b$ in $F_N$.
1961  The apparatus of continued fractions ensures that the  The apparatus of continued fractions ensures that the
1962  highest order convergent $s_k$ with $q_k\leq N$ is closer to $a/b$ than  highest order convergent $s_k$ with $q_k\leq N$ is closer to $a/b$ than
1963  to any neighboring term in $F_N$.  Thus, there is  to any neighboring term in $F_N$.  Thus, there is
1964  no intervening term of $F_N$ between $s_k$ and $a/b$.  no intervening term of $F_N$ between $s_k$ and $a/b$.
1965  If $k$ is even, $s_k<a/b$, and if $k$ is  If $k$ is even, $s_k<a/b$, and if $k$ is
1966  odd, $s_k>a/b$.  odd, $s_k>a/b$.
1967    
1968  It must be proved that (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) is the other Farey  It must be proved that (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) is the other Farey
1969  neighbor.  For brevity, only the case of $k$ even is proved:  the  neighbor.  For brevity, only the case of $k$ even is proved:  the
1970  case of $k$ odd is symmetrical.  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})  case of $k$ odd is symmetrical.  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
1971  is of the form (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05}),  is of the form (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05}),
1972  where $i \in \vworkintsetnonneg$.  where $i \in \vworkintsetnonneg$.
1973    
1974  \begin{equation}  \begin{equation}
1975  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:05}  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:05}
1976  \frac{{ip_k  + p_{k - 1} }}{{iq_k  + q_{k - 1} }}  \frac{{ip_k  + p_{k - 1} }}{{iq_k  + q_{k - 1} }}
1977  \end{equation}  \end{equation}
1978    
1979  $k$ is even, $s_k < a/b$, and the two Farey terms enclosing $a/b$, in  $k$ is even, $s_k < a/b$, and the two Farey terms enclosing $a/b$, in
1980  order, are  order, are
1981    
1982  \begin{equation}  \begin{equation}
1983  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:06}  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:06}
1984  \frac{p_k }{q_k },\frac{ip_k  + p_{k - 1} }{iq_k  + q_{k - 1} }.  \frac{p_k }{q_k },\frac{ip_k  + p_{k - 1} }{iq_k  + q_{k - 1} }.
1985  \end{equation}  \end{equation}
1986    
1987  Applying the $Kh - Hk = 1$ test, (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:07}), \  Applying the $Kh - Hk = 1$ test, (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:07}), \
1988  gives the  gives the
1989  result of 1, since by Theorem  result of 1, since by Theorem
1990  \ref{thm:ccfr0:scnv0:crossproductminusone},  \ref{thm:ccfr0:scnv0:crossproductminusone},
1991  $q_kp_{k-1}-p_kq_{k-1}=(-1)^k$.  $q_kp_{k-1}-p_kq_{k-1}=(-1)^k$.
1992    
1993  \begin{equation}  \begin{equation}
1994  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:07}  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:07}
1995  \begin{array}{*{20}c}  \begin{array}{*{20}c}
1996  {(q_k )(ip_k  + p_{k - 1} ) - (p_k )(iq_k  + q_{k - 1} ) = 1}  {(q_k )(ip_k  + p_{k - 1} ) - (p_k )(iq_k  + q_{k - 1} ) = 1}
1997  \end{array}  \end{array}
1998  \end{equation}  \end{equation}
1999    
2000  Thus, every potential Farey neighbor of the form (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05})  Thus, every potential Farey neighbor of the form (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05})
2001  meets the $Kh - Hk = 1$ test.  It is also straightforward  meets the $Kh - Hk = 1$ test.  It is also straightforward
2002  to show that \emph{only} potential Farey neighbors of the  to show that \emph{only} potential Farey neighbors of the
2003  form (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05}) can meet the $Kh-Hk=1$ test, using the  form (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05}) can meet the $Kh-Hk=1$ test, using the
2004  property that $p_k$ and $q_k$ are coprime.  property that $p_k$ and $q_k$ are coprime.
2005    
2006  It must be established that a  It must be established that a
2007  rational number of the form (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05})  rational number of the form (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05})
2008  is irreducible.  This result comes directly from  is irreducible.  This result comes directly from
2009  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:07}),  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:07}),
2010  since if the numerator  since if the numerator
2011  and denominator of (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) or  and denominator of (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) or
2012  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05}) are not coprime, the difference of 1 is  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05}) are not coprime, the difference of 1 is
2013  not possible.  not possible.
2014    
2015  The denominator of (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})  The denominator of (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
2016  can be rewritten as  can be rewritten as
2017    
2018  \begin{equation}  \begin{equation}
2019  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:08}  \label{eq:ccfr0:scba0:thm:cfenclosingneighbors:08}
2020  N - \left[ {\left( {N - q_{k - 1} } \right)\bmod q_k } \right] \in \left\{ {N - q_k  + 1,...,N} \right\}.  N - \left[ {\left( {N - q_{k - 1} } \right)\bmod q_k } \right] \in \left\{ {N - q_k  + 1,...,N} \right\}.
2021  \end{equation}  \end{equation}
2022    
2023  It must be shown that if one irreducible  It must be shown that if one irreducible
2024  rational number---namely, the rational number given by  rational number---namely, the rational number given by
2025  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})---with a denominator  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})---with a denominator
2026  $\in \{ N-q_k+1,\ldots{} ,N \}$ meets the $Kh - Hk = 1$  $\in \{ N-q_k+1,\ldots{} ,N \}$ meets the $Kh - Hk = 1$
2027  test, there can be no other irreducible rational number  test, there can be no other irreducible rational number
2028  in $F_N$ with a larger  in $F_N$ with a larger
2029  denominator which also meets this test.  denominator which also meets this test.
2030    
2031  Given (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:07}),  Given (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:07}),
2032  and given that \emph{only} rational numbers of the form  and given that \emph{only} rational numbers of the form
2033  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05})  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05})
2034  can meet the $Kh-Hk=1$ test, and given that any number of the  can meet the $Kh-Hk=1$ test, and given that any number of the
2035  form (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05})  form (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:05})
2036  is irreducible, the irreducible number meeting the  is irreducible, the irreducible number meeting the
2037  $Kh-Hk=1$ test with the next larger denominator after the denominator of  $Kh-Hk=1$ test with the next larger denominator after the denominator of
2038   (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})   (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
2039  will have a denominator $\in \{ N+1, \ldots, N+q_k \}$.  Thus,  will have a denominator $\in \{ N+1, \ldots, N+q_k \}$.  Thus,
2040  no other irreducible rational number in $F_N$ besides that given  no other irreducible rational number in $F_N$ besides that given
2041  by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) with a larger denominator  by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) with a larger denominator
2042  $\leq N$ and which meets the $Kh - Hk = 1$ test can exist; therefore  $\leq N$ and which meets the $Kh - Hk = 1$ test can exist; therefore
2043  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) is the other enclosing Farey neighbor to  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) is the other enclosing Farey neighbor to
2044  $a/b$ in $F_N$.  $a/b$ in $F_N$.
2045  \end{vworktheoremproof}  \end{vworktheoremproof}
2046  \vworktheoremfooter{}  \vworktheoremfooter{}
2047    
2048  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} establishes that  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} establishes that
2049  the two neighbors in $F_N$ to a rational number $a/b$ will be the highest-order  the two neighbors in $F_N$ to a rational number $a/b$ will be the highest-order
2050  convergent with a denominator not exceeding $N$, and the number  convergent with a denominator not exceeding $N$, and the number
2051  specified by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).  specified by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).
2052  An interesting and worthwhile question to ask about  An interesting and worthwhile question to ask about
2053  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} is which of the  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} is which of the
2054  two neighbors will be \emph{closer} to $a/b$---the convergent or the  two neighbors will be \emph{closer} to $a/b$---the convergent or the
2055  number specified by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})?  number specified by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})?
2056  Can we make any strong, simple, and easy-to-remember statements  Can we make any strong, simple, and easy-to-remember statements
2057  about the relative distance?  We answer this question and some related  about the relative distance?  We answer this question and some related
2058  questions now.  questions now.
2059    
2060  We are not aware of any rules that decisively predict which of the two  We are not aware of any rules that decisively predict which of the two
2061  Farey neighbors in Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}  Farey neighbors in Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}
2062  will be closer to $a/b$\footnote{We should qualify this by saying that  will be closer to $a/b$\footnote{We should qualify this by saying that
2063  we mean a rule which uses only partial quotients up through  we mean a rule which uses only partial quotients up through
2064  $a_k$ or at most $a_{k+1}$, which is the same information used  $a_k$ or at most $a_{k+1}$, which is the same information used
2065  by the theorem.  We should also add that although Theorem  by the theorem.  We should also add that although Theorem
2066  \ref{thm:ccfr0:scba0:cfenclosingneighbors} is worded to only consider  \ref{thm:ccfr0:scba0:cfenclosingneighbors} is worded to only consider
2067  non-negative rational numbers, the theorem and the results here  non-negative rational numbers, the theorem and the results here
2068  apply to non-negative irrational numbers as well, so long as enough partial  apply to non-negative irrational numbers as well, so long as enough partial
2069  quotients can be obtained.}, although Lemma  quotients can be obtained.}, although Lemma
2070  \ref{lem:ccfr0:scba0:enclosingneighborstheoremfurtherresult} is able  \ref{lem:ccfr0:scba0:enclosingneighborstheoremfurtherresult} is able
2071  to predict that the highest-ordered convergent $s_k$ with a denominator  to predict that the highest-ordered convergent $s_k$ with a denominator
2072  not exceeding $N$ will be closer in many cases.  not exceeding $N$ will be closer in many cases.
2073  In general, either neighbor may be closer.  In general, either neighbor may be closer.
2074  The most straightforward approach that we  The most straightforward approach that we
2075  are aware of is to calculate both Farey neighbors and to calculate  are aware of is to calculate both Farey neighbors and to calculate
2076  their respective distances from $a/b$.  The difficulty in devising a simple rule  their respective distances from $a/b$.  The difficulty in devising a simple rule
2077  to predict which neighbor  to predict which neighbor
2078  is closer is compounded by that fact that knowledge of  is closer is compounded by that fact that knowledge of
2079  $[a_0; a_1, \ldots{} , a_k]$ such that $s_k$ is the highest-ordered  $[a_0; a_1, \ldots{} , a_k]$ such that $s_k$ is the highest-ordered
2080  convergent with $q_k \leq N$ is incomplete knowledge of $a/b$ and can  convergent with $q_k \leq N$ is incomplete knowledge of $a/b$ and can
2081  only confine $a/b$ to an inequality in the sense suggested by  only confine $a/b$ to an inequality in the sense suggested by
2082  (\ref{eq:ccfr0:spar0:01}) through  (\ref{eq:ccfr0:spar0:01}) through
2083  (\ref{eq:ccfr0:spar0:03}).  Note that the  (\ref{eq:ccfr0:spar0:03}).  Note that the
2084  value specified by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})  value specified by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
2085  is an intermediate fraction, and that the statement of Theorem  is an intermediate fraction, and that the statement of Theorem
2086  \ref{thm:ccfr0:scba0:cfenclosingneighbors}  \ref{thm:ccfr0:scba0:cfenclosingneighbors}
2087  coincides with Khinchin's Theorem 15  coincides with Khinchin's Theorem 15
2088  (\cite{bibref:b:KhinchinClassic}, p. 22).  (\cite{bibref:b:KhinchinClassic}, p. 22).
2089    
2090  However, even in the absence of a rule to decisively  However, even in the absence of a rule to decisively
2091  predict which of the  predict which of the
2092  two Farey neighbors specified by Theorem  two Farey neighbors specified by Theorem
2093  \ref{thm:ccfr0:scba0:cfenclosingneighbors} is closer to $a/b$,  \ref{thm:ccfr0:scba0:cfenclosingneighbors} is closer to $a/b$,
2094  there are other useful properties of convergents  there are other useful properties of convergents
2095  as best approximations which we present  as best approximations which we present
2096  now.  now.
2097    
2098  It has been stated earlier that even-ordered convergents form an  It has been stated earlier that even-ordered convergents form an
2099  increasing sequence and that odd-ordered convergents also form a  increasing sequence and that odd-ordered convergents also form a
2100  decreasing sequence.  However, up to this point, we have not made  decreasing sequence.  However, up to this point, we have not made
2101  a statement about the relationship between even- and odd-ordered  a statement about the relationship between even- and odd-ordered
2102  convergents.  We present such a statement as Lemma  convergents.  We present such a statement as Lemma
2103  \ref{lem:ccfr0:scba0:convergenterrordecreases},  \ref{lem:ccfr0:scba0:convergenterrordecreases},
2104  below.  below.
2105    
2106  \begin{vworklemmastatement}  \begin{vworklemmastatement}
2107  \label{lem:ccfr0:scba0:convergenterrordecreases}  \label{lem:ccfr0:scba0:convergenterrordecreases}
2108  In the case of a finite or infinite continued fraction representation  In the case of a finite or infinite continued fraction representation
2109  of a non-negative rational or irrational  of a non-negative rational or irrational
2110  number $\alpha \in \vworkrealsetnonneg$, for all $k$,  number $\alpha \in \vworkrealsetnonneg$, for all $k$,
2111    
2112  \begin{equation}  \begin{equation}
2113  \label{eq:lem:ccfr0:scba0:convergenterrordecreases:01}  \label{eq:lem:ccfr0:scba0:convergenterrordecreases:01}
2114  \left| {\alpha - \frac{p_k}{q_k}} \right| <    \left| {\alpha - \frac{p_k}{q_k}} \right| <  
2115  \left| {\alpha - \frac{p_{k-1}}{q_{k-1}}} \right| .  \left| {\alpha - \frac{p_{k-1}}{q_{k-1}}} \right| .
2116  \end{equation}  \end{equation}
2117  In other words, convergents get ever-closer to $\alpha$, without  In other words, convergents get ever-closer to $\alpha$, without
2118  respect to whether they are even- or odd-ordered convergents.  respect to whether they are even- or odd-ordered convergents.
2119  \end{vworklemmastatement}  \end{vworklemmastatement}
2120  \begin{vworklemmaproof}  \begin{vworklemmaproof}
2121  In this proof, we show that for all $k$,  In this proof, we show that for all $k$,
2122    
2123  \begin{equation}  \begin{equation}
2124  \label{eq:lem:ccfr0:scba0:convergenterrordecreases:02}  \label{eq:lem:ccfr0:scba0:convergenterrordecreases:02}
2125  | s_{k-2} - s_{k-1} | > 2 | s_{k-1} - s_k | .  | s_{k-2} - s_{k-1} | > 2 | s_{k-1} - s_k | .
2126  \end{equation}  \end{equation}
2127    
2128  To understand why the proof is valid, consider the case of $k$ even,  To understand why the proof is valid, consider the case of $k$ even,
2129  in which case $s_k < \alpha$, so that $s_{k-1} - \alpha < s_{k-1} - s_k$.  in which case $s_k < \alpha$, so that $s_{k-1} - \alpha < s_{k-1} - s_k$.
2130  If $s_{k-1} - s_{k-2} > 2 (s_{k-1} - s_k)$, then  If $s_{k-1} - s_{k-2} > 2 (s_{k-1} - s_k)$, then
2131  $s_{k-2}$ is further to the left of $\alpha$ than $s_{k-1}$ is to the  $s_{k-2}$ is further to the left of $\alpha$ than $s_{k-1}$ is to the
2132  right of $\alpha$; thus (\ref{eq:lem:ccfr0:scba0:convergenterrordecreases:01})  right of $\alpha$; thus (\ref{eq:lem:ccfr0:scba0:convergenterrordecreases:01})
2133  applies.  A symmetrical argument holds for $k$ odd.  applies.  A symmetrical argument holds for $k$ odd.
2134    
2135  By Theorem \ref{thm:ccfr0:scnv0:crossproductminusone},  By Theorem \ref{thm:ccfr0:scnv0:crossproductminusone},
2136    
2137  \begin{equation}  \begin{equation}
2138  \label{eq:lem:ccfr0:scba0:convergenterrordecreases:03}  \label{eq:lem:ccfr0:scba0:convergenterrordecreases:03}
2139  s_{k-2} - s_{k-1}  s_{k-2} - s_{k-1}
2140  = \frac{p_{k-2}}{q_{k-2}}  = \frac{p_{k-2}}{q_{k-2}}
2141  - \frac{p_{k-1}}{q_{k-1}}  - \frac{p_{k-1}}{q_{k-1}}
2142  = \frac{(-1)^{k-1}}{q_{k-2} q_{k-1}} ,  = \frac{(-1)^{k-1}}{q_{k-2} q_{k-1}} ,
2143  \end{equation}  \end{equation}
2144    
2145  and similarly  and similarly
2146    
2147  \begin{equation}  \begin{equation}
2148  \label{eq:lem:ccfr0:scba0:convergenterrordecreases:04}  \label{eq:lem:ccfr0:scba0:convergenterrordecreases:04}
2149  s_{k-1} - s_{k}  s_{k-1} - s_{k}
2150  = \frac{p_{k-1}}{q_{k-1}}  = \frac{p_{k-1}}{q_{k-1}}
2151  - \frac{p_{k}}{q_{k}}  - \frac{p_{k}}{q_{k}}
2152  = \frac{(-1)^{k}}{q_{k-1} q_{k}} .  = \frac{(-1)^{k}}{q_{k-1} q_{k}} .
2153  \end{equation}  \end{equation}
2154    
2155  In order for (\ref{eq:lem:ccfr0:scba0:convergenterrordecreases:02})  In order for (\ref{eq:lem:ccfr0:scba0:convergenterrordecreases:02})
2156  to be met, it must be true that  to be met, it must be true that
2157  $2 q_{k-2} q_{k-1} < q_{k-1} q_k$, or equivalently that  $2 q_{k-2} q_{k-1} < q_{k-1} q_k$, or equivalently that
2158  $2 q_{k-2} < q_k$.  Since canonically $q_k = a_k q_{k-1} + q_{k-2}$  $2 q_{k-2} < q_k$.  Since canonically $q_k = a_k q_{k-1} + q_{k-2}$
2159  (Eq. \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:10}),  (Eq. \ref{eq:thm:ccfr0:scnv0:canonicalconvergentconstruction:10}),
2160  the requirement is that $2 q_{k-2} < a_k q_{k-1} + q_{k-2}$.    the requirement is that $2 q_{k-2} < a_k q_{k-1} + q_{k-2}$.  
2161  Since $a_k \geq 1$ and convergents are ever-increasing,  Since $a_k \geq 1$ and convergents are ever-increasing,
2162  (\ref{eq:lem:ccfr0:scba0:convergenterrordecreases:02}) is met and the  (\ref{eq:lem:ccfr0:scba0:convergenterrordecreases:02}) is met and the
2163  lemma is proved.  lemma is proved.
2164  \end{vworklemmaproof}  \end{vworklemmaproof}
2165  \vworklemmafooter{}  \vworklemmafooter{}
2166    
2167  Theorem \ref{thm:ccfr0:scba0:convergentcloseness} establishes a  Theorem \ref{thm:ccfr0:scba0:convergentcloseness} establishes a
2168  maximum distance from a number $\alpha$ that we wish to approximate  maximum distance from a number $\alpha$ that we wish to approximate
2169  to a convergent.  We now provide a second result that establishes  to a convergent.  We now provide a second result that establishes
2170  a \emph{minimum} distance.  (This result is Theorem 13, p.  a \emph{minimum} distance.  (This result is Theorem 13, p.
2171  15, from \cite{bibref:b:KhinchinClassic}.)  15, from \cite{bibref:b:KhinchinClassic}.)
2172    
2173  \begin{vworktheoremstatement}  \begin{vworktheoremstatement}
2174  \label{thm:ccfr0:scba0:convergentfarness}  \label{thm:ccfr0:scba0:convergentfarness}
2175  In the case of an infinite continued fraction representation  In the case of an infinite continued fraction representation
2176  $[a_0; a_1, a_2, \ldots]$ of  $[a_0; a_1, a_2, \ldots]$ of
2177  a non-negative irrational number $\alpha \in \vworkrealsetnonneg$,  a non-negative irrational number $\alpha \in \vworkrealsetnonneg$,
2178  for all $k \geq 0$; or in the case of a [necessarily finite]  for all $k \geq 0$; or in the case of a [necessarily finite]
2179  continued fraction representation $[a_0; a_1, a_2, \ldots , a_n]$  continued fraction representation $[a_0; a_1, a_2, \ldots , a_n]$
2180  of a non-negative rational number  of a non-negative rational number
2181  $\alpha \in \vworkrealsetnonneg$, for all $0 \leq k \leq n-1$,  $\alpha \in \vworkrealsetnonneg$, for all $0 \leq k \leq n-1$,
2182    
2183  \begin{equation}  \begin{equation}
2184  \label{eq:thm:ccfr0:scba0:convergentfarness:01}  \label{eq:thm:ccfr0:scba0:convergentfarness:01}
2185  \left| {\alpha - \frac{p_k}{q_k}} \right| > \frac{1}{q_k(q_{k+1}+q_k)} .  \left| {\alpha - \frac{p_k}{q_k}} \right| > \frac{1}{q_k(q_{k+1}+q_k)} .
2186  \end{equation}  \end{equation}
2187  \end{vworktheoremstatement}  \end{vworktheoremstatement}
2188  \begin{vworktheoremproof}  \begin{vworktheoremproof}
2189  We've already established (Lemma \ref{lem:ccfr0:scba0:convergenterrordecreases})  We've already established (Lemma \ref{lem:ccfr0:scba0:convergenterrordecreases})
2190  that each convergent $s_{k+1}$ is nearer to  that each convergent $s_{k+1}$ is nearer to
2191  a number $\alpha$ to be approximated than the previous  a number $\alpha$ to be approximated than the previous
2192  convergent, $s_k$, i.e. for all $k$,  convergent, $s_k$, i.e. for all $k$,
2193    
2194  \begin{equation}  \begin{equation}
2195  \label{eq:thm:ccfr0:scba0:convergentfarness:02}  \label{eq:thm:ccfr0:scba0:convergentfarness:02}
2196  \left| {\alpha - \frac{p_{k+1}}{q_{k+1}}} \right| <  \left| {\alpha - \frac{p_{k+1}}{q_{k+1}}} \right| <
2197  \left| {\alpha - \frac{p_{k}}{q_{k}}} \right| .  \left| {\alpha - \frac{p_{k}}{q_{k}}} \right| .
2198  \end{equation}  \end{equation}
2199    
2200  Since the mediant of two fractions always lies between  Since the mediant of two fractions always lies between
2201  them (Lemma \cfryzeroxrefhyphen{}\ref{lem:cfry0:spfs:02c}), it  them (Lemma \cfryzeroxrefhyphen{}\ref{lem:cfry0:spfs:02c}), it
2202  follows directly that  follows directly that
2203    
2204  \begin{equation}  \begin{equation}
2205  \label{eq:thm:ccfr0:scba0:convergentfarness:03}  \label{eq:thm:ccfr0:scba0:convergentfarness:03}
2206  \left| {\alpha - \frac{p_{k}}{q_{k}}} \right| >  \left| {\alpha - \frac{p_{k}}{q_{k}}} \right| >
2207  \left| {\frac{p_k + p_{k+1}}{q_k + q_{k+1}} - \frac{p_k}{q_k}} \right| =  \left| {\frac{p_k + p_{k+1}}{q_k + q_{k+1}} - \frac{p_k}{q_k}} \right| =
2208  \frac{1}{q_k ( q_k + q_{k+1})} .  \frac{1}{q_k ( q_k + q_{k+1})} .
2209  \end{equation}  \end{equation}
2210  \end{vworktheoremproof}  \end{vworktheoremproof}
2211  \begin{vworktheoremparsection}{Remark I}  \begin{vworktheoremparsection}{Remark I}
2212  This theorem can be combined with Theorem \ref{thm:ccfr0:scba0:convergentcloseness}  This theorem can be combined with Theorem \ref{thm:ccfr0:scba0:convergentcloseness}
2213  to give the following combined inequality:  to give the following combined inequality:
2214    
2215  \begin{equation}  \begin{equation}
2216  \label{eq:thm:ccfr0:scba0:convergentfarness:04}  \label{eq:thm:ccfr0:scba0:convergentfarness:04}
2217  \frac{1}{q_k ( q_k + q_{k+1})} <  \frac{1}{q_k ( q_k + q_{k+1})} <
2218  \left| {\alpha - \frac{p_{k}}{q_{k}}} \right| \leq  \left| {\alpha - \frac{p_{k}}{q_{k}}} \right| \leq
2219  \frac{1}{q_k q_{k+1}} .  \frac{1}{q_k q_{k+1}} .
2220  \end{equation}  \end{equation}
2221  \end{vworktheoremparsection}  \end{vworktheoremparsection}
2222  \vworktheoremfooter{}  \vworktheoremfooter{}
2223    
2224  We now supply an interesting and sometimes useful property of  We now supply an interesting and sometimes useful property of
2225  convergents used as best approximations.  Note that we later show that  convergents used as best approximations.  Note that we later show that
2226  Lemma \ref{lem:ccfr0:scba0:convergentbetterappthanlesserdenominator}  Lemma \ref{lem:ccfr0:scba0:convergentbetterappthanlesserdenominator}
2227  is a weak statement (a stronger statement can be made, Lemma  is a weak statement (a stronger statement can be made, Lemma
2228  \ref{lem:ccfr0:scba0:morecomplexconvergentbapprule}), but this lemma  \ref{lem:ccfr0:scba0:morecomplexconvergentbapprule}), but this lemma
2229  has the advantage of being extremely easy to remember.  has the advantage of being extremely easy to remember.
2230    
2231  \begin{vworklemmastatement}  \begin{vworklemmastatement}
2232  \label{lem:ccfr0:scba0:convergentbetterappthanlesserdenominator}  \label{lem:ccfr0:scba0:convergentbetterappthanlesserdenominator}
2233  A convergent $s_k = p_k/q_k$ to a non-negative [rational or irrational] number  A convergent $s_k = p_k/q_k$ to a non-negative [rational or irrational] number
2234  $\alpha \in \vworkrealsetnonneg$ is closer to $\alpha$  $\alpha \in \vworkrealsetnonneg$ is closer to $\alpha$
2235  than any other rational number with the same or a smaller  than any other rational number with the same or a smaller
2236  denominator.  denominator.
2237  \end{vworklemmastatement}  \end{vworklemmastatement}
2238  \begin{vworklemmaproof}  \begin{vworklemmaproof}
2239  Let $\alpha$ be the non-negative real number, rational or irrational,  Let $\alpha$ be the non-negative real number, rational or irrational,
2240  that we wish to approximate.  that we wish to approximate.
2241    
2242  If there is a number (let's call it $c/d$)  If there is a number (let's call it $c/d$)
2243  closer to $\alpha$ than $s_k = p_k / q_k$, with the same or a smaller denominator  closer to $\alpha$ than $s_k = p_k / q_k$, with the same or a smaller denominator
2244  than $s_k$, then by definition it must be in the Farey series of order  than $s_k$, then by definition it must be in the Farey series of order
2245  $q_k$, which we denote $F_{q_k}$.  $q_k$, which we denote $F_{q_k}$.
2246    
2247  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}
2248  assures us that the two Farey neighbors to $\alpha$ in $F_{q_k}$ will be  assures us that the two Farey neighbors to $\alpha$ in $F_{q_k}$ will be
2249  $s_k$ and the number given by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).  $s_k$ and the number given by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).
2250  Note that Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}  Note that Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}
2251  applies to irrational numbers as well (although the theorem statement  applies to irrational numbers as well (although the theorem statement
2252  does not indicate this), so we interpret  does not indicate this), so we interpret
2253  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}
2254  in that sense.  in that sense.
2255    
2256  Note in (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) that the  Note in (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) that the
2257  expression involving the $floor(\cdot{})$ function will evaluate  expression involving the $floor(\cdot{})$ function will evaluate
2258  to be zero, since $N=q_k$.  Thus, the other Farey neighbor to  to be zero, since $N=q_k$.  Thus, the other Farey neighbor to
2259  $\alpha$ in $F_{q_k}$ will be $s_{k-1} = p_{k-1}/q_{k-1}$.  $\alpha$ in $F_{q_k}$ will be $s_{k-1} = p_{k-1}/q_{k-1}$.
2260    
2261  We have already shown in Lemma \ref{lem:ccfr0:scba0:convergenterrordecreases}  We have already shown in Lemma \ref{lem:ccfr0:scba0:convergenterrordecreases}
2262  that $|\alpha - s_{k-1}| > |\alpha - s_{k}|$, therefore  that $|\alpha - s_{k-1}| > |\alpha - s_{k}|$, therefore
2263  $s_k$ is closer to $\alpha$ than the other Farey neighbor given  $s_k$ is closer to $\alpha$ than the other Farey neighbor given
2264  by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).  by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).
2265  Furthermore, because any $c/d$ which is closer to $\alpha$ than  Furthermore, because any $c/d$ which is closer to $\alpha$ than
2266  $s_k$ must be present in $F_{q_k}$, such a $c/d$ does not exist.  $s_k$ must be present in $F_{q_k}$, such a $c/d$ does not exist.
2267  \end{vworklemmaproof}  \end{vworklemmaproof}
2268  \begin{vworklemmaparsection}{Remark I}  \begin{vworklemmaparsection}{Remark I}
2269  In practice, this lemma is little more than parlor trivia  In practice, this lemma is little more than parlor trivia
2270  (it is not mathematically significant), but it is useful  (it is not mathematically significant), but it is useful
2271  information and very easy to remember.  For example, $355/113$ is a convergent to  information and very easy to remember.  For example, $355/113$ is a convergent to
2272  $\pi$, and it is sometimes useful to know that no better rational approximation  $\pi$, and it is sometimes useful to know that no better rational approximation
2273  can exist with the same or a smaller denominator.  can exist with the same or a smaller denominator.
2274  \end{vworklemmaparsection}  \end{vworklemmaparsection}
2275  \begin{vworklemmaparsection}{Remark II}  \begin{vworklemmaparsection}{Remark II}
2276  A stronger statement can be made (see  A stronger statement can be made (see
2277  Lemma \ref{lem:ccfr0:scba0:morecomplexconvergentbapprule}).  Lemma \ref{lem:ccfr0:scba0:morecomplexconvergentbapprule}).
2278  \end{vworklemmaparsection}  \end{vworklemmaparsection}
2279  \vworklemmafooter{}  \vworklemmafooter{}
2280    
2281  We now  We now
2282  present a stronger statement about convergents as best approximations that  present a stronger statement about convergents as best approximations that
2283  is not as easy to remember as  is not as easy to remember as
2284  Lemma \ref{lem:ccfr0:scba0:convergentbetterappthanlesserdenominator}.  Lemma \ref{lem:ccfr0:scba0:convergentbetterappthanlesserdenominator}.
2285    
2286  \begin{vworklemmastatement}  \begin{vworklemmastatement}
2287  \label{lem:ccfr0:scba0:morecomplexconvergentbapprule}  \label{lem:ccfr0:scba0:morecomplexconvergentbapprule}
2288  A convergent $s_k = p_k/q_k$ to a non-negative  A convergent $s_k = p_k/q_k$ to a non-negative
2289  [rational or irrational] number  [rational or irrational] number
2290  $\alpha \in \vworkrealsetnonneg$ is closer to $\alpha$  $\alpha \in \vworkrealsetnonneg$ is closer to $\alpha$
2291  than any other rational number with a denominator  than any other rational number with a denominator
2292  less than $q_k + q_{k-1}$.  less than $q_k + q_{k-1}$.
2293  \end{vworklemmastatement}  \end{vworklemmastatement}
2294  \begin{vworklemmaproof}  \begin{vworklemmaproof}
2295  Let $N$ be the denominator of a rational number which is  Let $N$ be the denominator of a rational number which is
2296  potentially closer to $\alpha$ than $s_k$.  If  potentially closer to $\alpha$ than $s_k$.  If
2297  $N < q_k + q_{k+1}$, then  $N < q_k + q_{k+1}$, then
2298  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
2299  evaluates to $s_{k-1}$, and Lemma  evaluates to $s_{k-1}$, and Lemma
2300  \ref{lem:ccfr0:scba0:convergenterrordecreases} has established that  \ref{lem:ccfr0:scba0:convergenterrordecreases} has established that
2301  $s_k$ is closer to $\alpha$ than $s_{k-1}$.  If, on the other  $s_k$ is closer to $\alpha$ than $s_{k-1}$.  If, on the other
2302  hand, $N \geq q_k + q_{k+1}$, then the intermediate fraction specified by  hand, $N \geq q_k + q_{k+1}$, then the intermediate fraction specified by
2303  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) \emph{may} be  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) \emph{may} be
2304  closer to $\alpha$ than $s_k$.  closer to $\alpha$ than $s_k$.
2305  \end{vworklemmaproof}  \end{vworklemmaproof}
2306  \begin{vworklemmaparsection}{Remark I}  \begin{vworklemmaparsection}{Remark I}
2307  This statement is harder to remember, but a stronger statement  This statement is harder to remember, but a stronger statement
2308  than Lemma \ref{lem:ccfr0:scba0:convergentbetterappthanlesserdenominator}.  than Lemma \ref{lem:ccfr0:scba0:convergentbetterappthanlesserdenominator}.
2309  \end{vworklemmaparsection}  \end{vworklemmaparsection}
2310  \begin{vworklemmaparsection}{Remark II}  \begin{vworklemmaparsection}{Remark II}
2311  Note that the only valid implication is $N < q_k + q_{k+1} \rightarrow$  Note that the only valid implication is $N < q_k + q_{k+1} \rightarrow$
2312  (convergent is closer).  Note that  (convergent is closer).  Note that
2313  $N \geq q_k + q_{k+1} \nrightarrow$ (intermediate fraction is closer)!  $N \geq q_k + q_{k+1} \nrightarrow$ (intermediate fraction is closer)!
2314  If $N \geq q_k + q_{k+1}$, either the convergent or the intermediate fraction  If $N \geq q_k + q_{k+1}$, either the convergent or the intermediate fraction
2315  may be closer.  may be closer.
2316  This statement is harder to remember, but a stronger statement  This statement is harder to remember, but a stronger statement
2317  than Lemma \ref{lem:ccfr0:scba0:convergentbetterappthanlesserdenominator}.  than Lemma \ref{lem:ccfr0:scba0:convergentbetterappthanlesserdenominator}.
2318  \end{vworklemmaparsection}  \end{vworklemmaparsection}
2319  \vworklemmafooter{}  \vworklemmafooter{}
2320    
2321  Finally, we present a result about Theorem  Finally, we present a result about Theorem
2322  \ref{thm:ccfr0:scba0:cfenclosingneighbors} that will predict  \ref{thm:ccfr0:scba0:cfenclosingneighbors} that will predict
2323  in some circumstances that the highest-ordered convergent  in some circumstances that the highest-ordered convergent
2324  $s_k$ with a denominator not exceeding $N$ must be closer  $s_k$ with a denominator not exceeding $N$ must be closer
2325  to $a/b$ than the intermediate fraction specified by  to $a/b$ than the intermediate fraction specified by
2326  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).
2327    
2328  \begin{vworklemmastatement}  \begin{vworklemmastatement}
2329  \label{lem:ccfr0:scba0:enclosingneighborstheoremfurtherresult}  \label{lem:ccfr0:scba0:enclosingneighborstheoremfurtherresult}
2330  In Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors},  In Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors},
2331  if $N < q_k + q_{k-1}$, the highest ordered convergent  if $N < q_k + q_{k-1}$, the highest ordered convergent
2332  $s_k$ with a denominator not exceeding $N$ is closer to  $s_k$ with a denominator not exceeding $N$ is closer to
2333  $a/b$\footnote{Note that this result is also valid for  $a/b$\footnote{Note that this result is also valid for
2334  convergents to an irrational number, although  convergents to an irrational number, although
2335  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} is  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} is
2336  not worded in this way.} then the intermediate fraction specified by  not worded in this way.} then the intermediate fraction specified by
2337  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}).
2338  If $N \geq q_k + q_{k-1}$, either $s_k$ or the intermediate  If $N \geq q_k + q_{k-1}$, either $s_k$ or the intermediate
2339  fraction specified by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})  fraction specified by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
2340  may be closer.  may be closer.
2341  \end{vworklemmastatement}  \end{vworklemmastatement}
2342  \begin{vworklemmaproof}  \begin{vworklemmaproof}
2343  See the proof of Lemma  See the proof of Lemma
2344  \ref{lem:ccfr0:scba0:morecomplexconvergentbapprule}.  \ref{lem:ccfr0:scba0:morecomplexconvergentbapprule}.
2345  \end{vworklemmaproof}  \end{vworklemmaproof}
2346  \vworklemmafooter{}  \vworklemmafooter{}
2347    
2348  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} immediately suggests  Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors} immediately suggests
2349  an algorithm for obtaining the enclosing rational numbers in $F_N$  an algorithm for obtaining the enclosing rational numbers in $F_N$
2350  to a rational number $a/b \notin F_N$, which we present as  to a rational number $a/b \notin F_N$, which we present as
2351  Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}.  Although  Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}.  Although
2352  we don't formally show it, the algorithm is $O(log \; N)$, due to  we don't formally show it, the algorithm is $O(log \; N)$, due to
2353  the minimum geometric rate of increase of convergents  the minimum geometric rate of increase of convergents
2354  (Theorem \ref{thm:ccfr0:scnv0:minimumrateofconvergentdenominatorincrease}).  (Theorem \ref{thm:ccfr0:scnv0:minimumrateofconvergentdenominatorincrease}).
2355  Note that the algorithm will proceed only until $q_k > N$, not necessarily  Note that the algorithm will proceed only until $q_k > N$, not necessarily
2356  until all partial quotients of $a/b$ are obtained.  Note also that the  until all partial quotients of $a/b$ are obtained.  Note also that the
2357  algorithm can be applied to irrational numbers with minor  algorithm can be applied to irrational numbers with minor
2358  modification (all that matters is that we can obtain enough  modification (all that matters is that we can obtain enough
2359  partial quotients).  partial quotients).
2360    
2361  \begin{vworkalgorithmstatementpar}{Enclosing Neighbors Of \mbox{\boldmath $a/b \notin F_N$}  \begin{vworkalgorithmstatementpar}{Enclosing Neighbors Of \mbox{\boldmath $a/b \notin F_N$}
2362                                   In \mbox{\boldmath $F_N$}}                                   In \mbox{\boldmath $F_N$}}
2363  \label{alg:ccfr0:scba0:cfenclosingneighborsfn}  \label{alg:ccfr0:scba0:cfenclosingneighborsfn}
2364  \begin{alglvl0}  \begin{alglvl0}
2365  \item $k := -1$.  \item $k := -1$.
2366  \item $divisor_{-1} := a$.  \item $divisor_{-1} := a$.
2367  \item $remainder_{-1} := b$.  \item $remainder_{-1} := b$.
2368  \item $p_{-1} := 1$.  \item $p_{-1} := 1$.
2369  \item $q_{-1} := 0$.  \item $q_{-1} := 0$.
2370    
2371  \item Repeat  \item Repeat
2372    
2373  \begin{alglvl1}  \begin{alglvl1}
2374  \item $k := k + 1$.  \item $k := k + 1$.
2375  \item $dividend_k := divisor_{k-1}$.  \item $dividend_k := divisor_{k-1}$.
2376  \item $divisor_k  := remainder_{k-1}$.  \item $divisor_k  := remainder_{k-1}$.
2377  \item $a_k :=  dividend_k \; div \; divisor_k$.  \item $a_k :=  dividend_k \; div \; divisor_k$.
2378  \item $remainder_k := dividend_k \; mod \; divisor_k$.  \item $remainder_k := dividend_k \; mod \; divisor_k$.
2379  \item If $k=0$ then $p_k := a_k$ else $p_k := a_k p_{k-1} + p_{k-2}$.  \item If $k=0$ then $p_k := a_k$ else $p_k := a_k p_{k-1} + p_{k-2}$.
2380  \item If $k=0$ then $q_k := 1$ else $q_k := a_k q_{k-1} + q_{k-2}$.  \item If $k=0$ then $q_k := 1$ else $q_k := a_k q_{k-1} + q_{k-2}$.
2381  \end{alglvl1}  \end{alglvl1}
2382    
2383  \item Until ($q_k > k_{MAX}$).  \item Until ($q_k > k_{MAX}$).
2384  \item $s_{k-1} = p_{k-1}/q_{k-1}$ will be one Farey neighbor to $a/b$ in $F_{k_{MAX}}$.  \item $s_{k-1} = p_{k-1}/q_{k-1}$ will be one Farey neighbor to $a/b$ in $F_{k_{MAX}}$.
2385        Apply (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})        Apply (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
2386            to obtain the other Farey neighbor.            to obtain the other Farey neighbor.
2387  \end{alglvl0}  \end{alglvl0}
2388  \end{vworkalgorithmstatementpar}  \end{vworkalgorithmstatementpar}
2389  %\vworkalgorithmfooter{}  %\vworkalgorithmfooter{}
2390    
2391  \begin{vworkexamplestatement}  \begin{vworkexamplestatement}
2392  \label{ex:ccfr0:scba0:bestrapapptoratnum}  \label{ex:ccfr0:scba0:bestrapapptoratnum}
2393  Find the members of $F_{100}$ which enclose the conversion factor  Find the members of $F_{100}$ which enclose the conversion factor
2394  from kilometers-per-hour to miles-per-hour.  Assume that  from kilometers-per-hour to miles-per-hour.  Assume that
2395  one mile is 1.6093 kilometers (exactly).  one mile is 1.6093 kilometers (exactly).
2396  \end{vworkexamplestatement}  \end{vworkexamplestatement}
2397  \begin{vworkexampleparsection}{Solution}  \begin{vworkexampleparsection}{Solution}
2398  The conversion factor from KPH to MPH is the reciprocal of 1.6093.  As a rational  The conversion factor from KPH to MPH is the reciprocal of 1.6093.  As a rational
2399  number, 1.6093 is 16,093/10,000, so 10,000/16,093 is its exact reciprocal.  number, 1.6093 is 16,093/10,000, so 10,000/16,093 is its exact reciprocal.
2400  Applying Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}  Applying Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}
2401  with $a/b = 10,000/16,093$ and $k_{MAX} = 100$ yields Table  with $a/b = 10,000/16,093$ and $k_{MAX} = 100$ yields Table
2402  \ref{tbl:ex:ccfr0:scba0:bestrapapptoratnum}.  \ref{tbl:ex:ccfr0:scba0:bestrapapptoratnum}.
2403    
2404  \begin{table}  \begin{table}
2405  \caption{Application Of Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}  \caption{Application Of Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}
2406           To Find Members Of $F_{100}$ Which Enclose 10,000/16,093           To Find Members Of $F_{100}$ Which Enclose 10,000/16,093
2407                   (Example \ref{ex:ccfr0:scba0:bestrapapptoratnum})}                   (Example \ref{ex:ccfr0:scba0:bestrapapptoratnum})}
2408  \label{tbl:ex:ccfr0:scba0:bestrapapptoratnum}  \label{tbl:ex:ccfr0:scba0:bestrapapptoratnum}
2409  \begin{center}  \begin{center}
2410  \begin{tabular}{|c|c|c|c|c|c|c|}  \begin{tabular}{|c|c|c|c|c|c|c|}
2411  \hline  \hline
2412  \small{Index} & \small{$dividend_k$}  & \small{$divisor_k$} & \small{$a_k$}   & \small{$remainder_k$} & \small{$p_k$}    & \small{$q_k$}  \\  \small{Index} & \small{$dividend_k$}  & \small{$divisor_k$} & \small{$a_k$}   & \small{$remainder_k$} & \small{$p_k$}    & \small{$q_k$}  \\
2413  \small{($k$)} &                       &                     &                 &                       &                  &                \\  \small{($k$)} &                       &                     &                 &                       &                  &                \\
2414  \hline  \hline
2415  \hline  \hline
2416  \small{-1}    & \small{N/A}           & \small{10,000}      & \small{N/A}     & \small{16,093}        & \small{1}        & \small{0}      \\  \small{-1}    & \small{N/A}           & \small{10,000}      & \small{N/A}     & \small{16,093}        & \small{1}        & \small{0}      \\
2417  \hline  \hline
2418  \small{0}     & \small{10,000}        & \small{16,093}      & \small{0}       & \small{10,000}        & \small{0}        & \small{1}      \\  \small{0}     & \small{10,000}        & \small{16,093}      & \small{0}       & \small{10,000}        & \small{0}        & \small{1}      \\
2419  \hline  \hline
2420  \small{1}     & \small{16,093}        & \small{10,000}      & \small{1}       & \small{6,093}         & \small{1}        & \small{1}      \\  \small{1}     & \small{16,093}        & \small{10,000}      & \small{1}       & \small{6,093}         & \small{1}        & \small{1}      \\
2421  \hline  \hline
2422  \small{2}     & \small{10,000}        & \small{6,093}       & \small{1}       & \small{3,907}         & \small{1}        & \small{2}      \\  \small{2}     & \small{10,000}        & \small{6,093}       & \small{1}       & \small{3,907}         & \small{1}        & \small{2}      \\
2423  \hline  \hline
2424  \small{3}     & \small{6,093}         & \small{3,907}       & \small{1}       & \small{2,186}         & \small{2}        & \small{3}      \\  \small{3}     & \small{6,093}         & \small{3,907}       & \small{1}       & \small{2,186}         & \small{2}        & \small{3}      \\
2425  \hline  \hline
2426  \small{4}     & \small{3,907}         & \small{2,186}       & \small{1}       & \small{1,721}         & \small{3}        & \small{5}      \\  \small{4}     & \small{3,907}         & \small{2,186}       & \small{1}       & \small{1,721}         & \small{3}        & \small{5}      \\
2427  \hline  \hline
2428  \small{5}     & \small{2,186}         & \small{1,721}       & \small{1}       & \small{465}           & \small{5}        & \small{8}      \\  \small{5}     & \small{2,186}         & \small{1,721}       & \small{1}       & \small{465}           & \small{5}        & \small{8}      \\
2429  \hline  \hline
2430  \small{6}     & \small{1,721}         & \small{465}         & \small{3}       & \small{326}           & \small{18}       & \small{29}     \\  \small{6}     & \small{1,721}         & \small{465}         & \small{3}       & \small{326}           & \small{18}       & \small{29}     \\
2431  \hline  \hline
2432  \small{7}     & \small{465}           & \small{326}         & \small{1}       & \small{139}           & \small{23}       & \small{37}     \\  \small{7}     & \small{465}           & \small{326}         & \small{1}       & \small{139}           & \small{23}       & \small{37}     \\
2433  \hline  \hline
2434  \small{8}     & \small{326}           & \small{139}         & \small{2}       & \small{48}            & \small{64}       & \small{103}    \\  \small{8}     & \small{326}           & \small{139}         & \small{2}       & \small{48}            & \small{64}       & \small{103}    \\
2435  \hline  \hline
2436  \end{tabular}  \end{tabular}
2437  \end{center}  \end{center}
2438  \end{table}  \end{table}
2439    
2440  Note from Table \ref{tbl:ex:ccfr0:scba0:bestrapapptoratnum}  Note from Table \ref{tbl:ex:ccfr0:scba0:bestrapapptoratnum}
2441  that the 7-th order convergent, $s_7 = 23/37$,  that the 7-th order convergent, $s_7 = 23/37$,
2442  is the highest-ordered convergent with $q_k \leq 100$, so  is the highest-ordered convergent with $q_k \leq 100$, so
2443  by Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}, 23/37  by Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}, 23/37
2444  is one neighbor in $F_{100}$ to 10,000/16,093.  Because $s_7$  is one neighbor in $F_{100}$ to 10,000/16,093.  Because $s_7$
2445  is an odd-ordered convergent, it will be the right  is an odd-ordered convergent, it will be the right
2446  Farey neighbor.  Farey neighbor.
2447  By (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}), the  By (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}), the
2448  other Farey neighbor is 41/66, and it will be the left  other Farey neighbor is 41/66, and it will be the left
2449  Farey neighbor.  Farey neighbor.
2450  \end{vworkexampleparsection}  \end{vworkexampleparsection}
2451  %\vworkexamplefooter{}  %\vworkexamplefooter{}
2452    
2453    
2454  \begin{vworkexamplestatement}  \begin{vworkexamplestatement}
2455  \label{ex:ccfr0:scba0:bestrapapptoirratnum}  \label{ex:ccfr0:scba0:bestrapapptoirratnum}
2456  Find the members of $F_{200}$ which  Find the members of $F_{200}$ which
2457  enclose $\sqrt{3}$.  enclose $\sqrt{3}$.
2458  \end{vworkexamplestatement}  \end{vworkexamplestatement}
2459  \begin{vworkexampleparsection}{Solution}  \begin{vworkexampleparsection}{Solution}
2460  We demonstrated in Example  We demonstrated in Example
2461  \ref{ex:ccfr0:scin0:symboliccfalgorithmexample}  \ref{ex:ccfr0:scin0:symboliccfalgorithmexample}
2462  that the continued fraction representation of  that the continued fraction representation of
2463  $\sqrt{3}$ is $[1;\overline{1,2}]$.  $\sqrt{3}$ is $[1;\overline{1,2}]$.
2464  As is highlighted in Footnote  As is highlighted in Footnote
2465  \ref{footnote:ccfr0:scba0:rationalitynotrequired}, it isn't required  \ref{footnote:ccfr0:scba0:rationalitynotrequired}, it isn't required
2466  that a number be rational to apply Theorem  that a number be rational to apply Theorem
2467  \ref{thm:ccfr0:scba0:cfenclosingneighbors}, so long as  \ref{thm:ccfr0:scba0:cfenclosingneighbors}, so long as
2468  enough partial quotients can be obtained.  enough partial quotients can be obtained.
2469  Using knowledge of the partial quotients of  Using knowledge of the partial quotients of
2470  $\sqrt{3}$ and applying Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}  $\sqrt{3}$ and applying Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}
2471  yields Table \ref{tbl:ex:ccfr0:scba0:bestrapapptoirratnum} (note that it isn't necessary  yields Table \ref{tbl:ex:ccfr0:scba0:bestrapapptoirratnum} (note that it isn't necessary
2472  to track remainders, as we already have all of the partial quotients for  to track remainders, as we already have all of the partial quotients for
2473  $\sqrt{3}$).  $\sqrt{3}$).
2474    
2475  \begin{table}  \begin{table}
2476  \caption{Application Of Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}  \caption{Application Of Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}
2477           To Find Members Of $F_{100}$ Which Enclose $\sqrt{3}$           To Find Members Of $F_{100}$ Which Enclose $\sqrt{3}$
2478                   (Example \ref{ex:ccfr0:scba0:bestrapapptoirratnum})}                   (Example \ref{ex:ccfr0:scba0:bestrapapptoirratnum})}
2479  \label{tbl:ex:ccfr0:scba0:bestrapapptoirratnum}  \label{tbl:ex:ccfr0:scba0:bestrapapptoirratnum}
2480  \begin{center}  \begin{center}
2481  \begin{tabular}{|c|c|c|c|}  \begin{tabular}{|c|c|c|c|}
2482  \hline  \hline
2483  \hspace{0.15in}\small{Index ($k$)}\hspace{0.15in} & \hspace{0.15in}\small{$a_k$}\hspace{0.15in}   &  \hspace{0.15in}\small{Index ($k$)}\hspace{0.15in} & \hspace{0.15in}\small{$a_k$}\hspace{0.15in}   &
2484   \hspace{0.15in}\small{$p_k$}\hspace{0.15in}    & \hspace{0.15in}\small{$q_k$}\hspace{0.15in}  \\   \hspace{0.15in}\small{$p_k$}\hspace{0.15in}    & \hspace{0.15in}\small{$q_k$}\hspace{0.15in}  \\
2485  \hline  \hline
2486  \hline  \hline
2487  \small{-1}    & \small{N/A}     & \small{1}        & \small{0}      \\  \small{-1}    & \small{N/A}     & \small{1}        & \small{0}      \\
2488  \hline  \hline
2489  \small{0}     & \small{1}       & \small{1}        & \small{1}      \\  \small{0}     & \small{1}       & \small{1}        & \small{1}      \\
2490  \hline  \hline
2491  \small{1}     & \small{1}       & \small{2}        & \small{1}      \\  \small{1}     & \small{1}       & \small{2}        & \small{1}      \\
2492  \hline  \hline
2493  \small{2}     & \small{2}       & \small{5}        & \small{3}      \\  \small{2}     & \small{2}       & \small{5}        & \small{3}      \\
2494  \hline  \hline
2495  \small{3}     & \small{1}       & \small{7}        & \small{4}      \\  \small{3}     & \small{1}       & \small{7}        & \small{4}      \\
2496  \hline  \hline
2497  \small{4}     & \small{2}       & \small{19}       & \small{11}     \\  \small{4}     & \small{2}       & \small{19}       & \small{11}     \\
2498  \hline  \hline
2499  \small{5}     & \small{1}       & \small{26}       & \small{15}     \\  \small{5}     & \small{1}       & \small{26}       & \small{15}     \\
2500  \hline  \hline
2501  \small{6}     & \small{2}       & \small{71}       & \small{41}     \\  \small{6}     & \small{2}       & \small{71}       & \small{41}     \\
2502  \hline  \hline
2503  \small{7}     & \small{1}       & \small{97}       & \small{56}     \\  \small{7}     & \small{1}       & \small{97}       & \small{56}     \\
2504  \hline  \hline
2505  \small{8}     & \small{2}       & \small{265}      & \small{153}    \\  \small{8}     & \small{2}       & \small{265}      & \small{153}    \\
2506  \hline  \hline
2507  \small{9}     & \small{1}       & \small{362}      & \small{209}    \\  \small{9}     & \small{1}       & \small{362}      & \small{209}    \\
2508  \hline  \hline
2509  \end{tabular}  \end{tabular}
2510  \end{center}  \end{center}
2511  \end{table}  \end{table}
2512    
2513  Note from Table \ref{tbl:ex:ccfr0:scba0:bestrapapptoirratnum}  Note from Table \ref{tbl:ex:ccfr0:scba0:bestrapapptoirratnum}
2514  that the 8-th order convergent, $s_8 = 265/153$,  that the 8-th order convergent, $s_8 = 265/153$,
2515  is the highest-ordered convergent with $q_k \leq 200$, so  is the highest-ordered convergent with $q_k \leq 200$, so
2516  by Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}, 265/153  by Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}, 265/153
2517  is one neighbor in $F_{100}$ to $\sqrt{3}$.  Because $s_8$  is one neighbor in $F_{100}$ to $\sqrt{3}$.  Because $s_8$
2518  is an even-ordered convergent, it will be the left  is an even-ordered convergent, it will be the left
2519  Farey neighbor.  Farey neighbor.
2520  By (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}), the  By (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}), the
2521  other Farey neighbor is 97/56, and it will be the right  other Farey neighbor is 97/56, and it will be the right
2522  Farey neighbor.  Farey neighbor.
2523  \end{vworkexampleparsection}  \end{vworkexampleparsection}
2524  \vworkexamplefooter{}  \vworkexamplefooter{}
2525    
2526    
2527  It is clear that Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}  It is clear that Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfn}
2528  can be trivially modified to find enclosing neighbors  can be trivially modified to find enclosing neighbors
2529  in $F_{k_{MAX},\overline{h_{MAX}}}$, and we present this  in $F_{k_{MAX},\overline{h_{MAX}}}$, and we present this
2530  trivial modification as Algorithm  trivial modification as Algorithm
2531  \ref{alg:ccfr0:scba0:cfenclosingneighborsfab}.  \ref{alg:ccfr0:scba0:cfenclosingneighborsfab}.
2532    
2533  \begin{vworkalgorithmstatementpar}{Enclosing Neighbors Of  \begin{vworkalgorithmstatementpar}{Enclosing Neighbors Of
2534                                     \mbox{\boldmath $x \notin F_{k_{MAX},\overline{h_{MAX}}}$}                                     \mbox{\boldmath $x \notin F_{k_{MAX},\overline{h_{MAX}}}$}
2535                                     In \mbox{\boldmath $F_{k_{MAX},\overline{h_{MAX}}}$}}                                     In \mbox{\boldmath $F_{k_{MAX},\overline{h_{MAX}}}$}}
2536  \label{alg:ccfr0:scba0:cfenclosingneighborsfab}  \label{alg:ccfr0:scba0:cfenclosingneighborsfab}
2537  \begin{alglvl0}  \begin{alglvl0}
2538  \item If $a/b < h_{MAX}/k_{MAX}$, apply Algorithm  \item If $a/b < h_{MAX}/k_{MAX}$, apply Algorithm
2539        \ref{alg:ccfr0:scba0:cfenclosingneighborsfn} directly;        \ref{alg:ccfr0:scba0:cfenclosingneighborsfn} directly;
2540    
2541  \item Else if $a/b > h_{MAX}/k_{MAX}$, apply Algorithm  \item Else if $a/b > h_{MAX}/k_{MAX}$, apply Algorithm
2542        \ref{alg:ccfr0:scba0:cfenclosingneighborsfn} using $b/a$ rather        \ref{alg:ccfr0:scba0:cfenclosingneighborsfn} using $b/a$ rather
2543            than $a/b$ as the input to the algorithm, using $h_{MAX}$            than $a/b$ as the input to the algorithm, using $h_{MAX}$
2544            rather than $k_{MAX}$ as $N$, and            rather than $k_{MAX}$ as $N$, and
2545            using the reciprocals of the results of the algorithm.\footnote{The            using the reciprocals of the results of the algorithm.\footnote{The
2546            basis for taking the reciprocals of input and output and            basis for taking the reciprocals of input and output and
2547            using $h_{MAX}$ rather than $k_{MAX}$ are explained            using $h_{MAX}$ rather than $k_{MAX}$ are explained
2548            in \cfryzeroxrefcomma{}Section \ref{cfry0:schk0}.}            in \cfryzeroxrefcomma{}Section \ref{cfry0:schk0}.}
2549    
2550  \end{alglvl0}  \end{alglvl0}
2551  \end{vworkalgorithmstatementpar}  \end{vworkalgorithmstatementpar}
2552  %\vworkalgorithmfooter{}  %\vworkalgorithmfooter{}
2553    
2554  \begin{vworkexamplestatement}  \begin{vworkexamplestatement}
2555  \label{ex:ccfr0:scba0:bestratapptoirratnum2d}  \label{ex:ccfr0:scba0:bestratapptoirratnum2d}
2556  Find the members of $F_{200,\overline{100}}$ which  Find the members of $F_{200,\overline{100}}$ which
2557  enclose $\sqrt{3}$.  enclose $\sqrt{3}$.
2558  \end{vworkexamplestatement}  \end{vworkexamplestatement}
2559  \begin{vworkexampleparsection}{Solution}  \begin{vworkexampleparsection}{Solution}
2560  It was shown in Example \ref{ex:ccfr0:scba0:bestrapapptoirratnum}  It was shown in Example \ref{ex:ccfr0:scba0:bestrapapptoirratnum}
2561  that the two enclosing neighbors to $\sqrt{3}$ in  that the two enclosing neighbors to $\sqrt{3}$ in
2562  $F_{200}$ are 265/153 and 97/56.  Note that the first of  $F_{200}$ are 265/153 and 97/56.  Note that the first of
2563  these neighbors, 265/153, violates the constraint on the  these neighbors, 265/153, violates the constraint on the
2564  numerator.  numerator.
2565  As explained in Section \cfryzeroxrefhyphen{}\ref{cfry0:schk0},  As explained in Section \cfryzeroxrefhyphen{}\ref{cfry0:schk0},
2566  because $\sqrt{3} > 100/200$, the constraint on the  because $\sqrt{3} > 100/200$, the constraint on the
2567  numerator is the dominant constraint, and the necessary  numerator is the dominant constraint, and the necessary
2568  approach is to find the neighbors of $1/\sqrt{3}$ in  approach is to find the neighbors of $1/\sqrt{3}$ in
2569  $F_{100}$, then invert the results.  $F_{100}$, then invert the results.
2570  Although we don't explain it in this work,  Although we don't explain it in this work,
2571  the reciprocal of a continued fraction can be formed by  the reciprocal of a continued fraction can be formed by
2572  ``right-shifting'' or ``left-shifting'' the continued fraction one position.  ``right-shifting'' or ``left-shifting'' the continued fraction one position.
2573  Thus, if $[1;1,2,1,2,1,2, \ldots{}]$ = $[1;\overline{1,2}]$  Thus, if $[1;1,2,1,2,1,2, \ldots{}]$ = $[1;\overline{1,2}]$
2574  is the continued fraction representation of $\sqrt{3}$, then  is the continued fraction representation of $\sqrt{3}$, then
2575  $[0;1,1,2,1,2,1, \ldots{}]$ = $[0;1,\overline{1,2}]$ is the  $[0;1,1,2,1,2,1, \ldots{}]$ = $[0;1,\overline{1,2}]$ is the
2576  continued fraction representation of $1/\sqrt{3}$.  Using  continued fraction representation of $1/\sqrt{3}$.  Using
2577  this result and constructing the convergents until  this result and constructing the convergents until
2578  $q_k \geq 100$ yields Table \ref{tbl:ex:ccfr0:scba0:bestratapptoirratnum2d}.  $q_k \geq 100$ yields Table \ref{tbl:ex:ccfr0:scba0:bestratapptoirratnum2d}.
2579    
2580  \begin{table}  \begin{table}
2581  \caption{Application Of Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfab}  \caption{Application Of Algorithm \ref{alg:ccfr0:scba0:cfenclosingneighborsfab}
2582           To Find Members Of $F_{100}$ Which Enclose $1/\sqrt{3}$           To Find Members Of $F_{100}$ Which Enclose $1/\sqrt{3}$
2583                   (Example \ref{ex:ccfr0:scba0:bestratapptoirratnum2d})}                   (Example \ref{ex:ccfr0:scba0:bestratapptoirratnum2d})}
2584  \label{tbl:ex:ccfr0:scba0:bestratapptoirratnum2d}  \label{tbl:ex:ccfr0:scba0:bestratapptoirratnum2d}
2585  \begin{center}  \begin{center}
2586  \begin{tabular}{|c|c|c|c|}  \begin{tabular}{|c|c|c|c|}
2587  \hline  \hline
2588  \hspace{0.15in}\small{Index ($k$)}\hspace{0.15in} & \hspace{0.15in}\small{$a_k$}\hspace{0.15in}   &  \hspace{0.15in}\small{Index ($k$)}\hspace{0.15in} & \hspace{0.15in}\small{$a_k$}\hspace{0.15in}   &
2589   \hspace{0.15in}\small{$p_k$}\hspace{0.15in}    & \hspace{0.15in}\small{$q_k$}\hspace{0.15in}  \\   \hspace{0.15in}\small{$p_k$}\hspace{0.15in}    & \hspace{0.15in}\small{$q_k$}\hspace{0.15in}  \\
2590  \hline  \hline
2591  \hline  \hline
2592  \small{-1}    & \small{N/A}     & \small{1}        & \small{0}      \\  \small{-1}    & \small{N/A}     & \small{1}        & \small{0}      \\
2593  \hline  \hline
2594  \small{0}     & \small{0}       & \small{0}        & \small{1}      \\  \small{0}     & \small{0}       & \small{0}        & \small{1}      \\
2595  \hline  \hline
2596  \small{1}     & \small{1}       & \small{1}        & \small{1}      \\  \small{1}     & \small{1}       & \small{1}        & \small{1}      \\
2597  \hline  \hline
2598  \small{2}     & \small{1}       & \small{1}        & \small{2}      \\  \small{2}     & \small{1}       & \small{1}        & \small{2}      \\
2599  \hline  \hline
2600  \small{3}     & \small{2}       & \small{3}        & \small{5}      \\  \small{3}     & \small{2}       & \small{3}        & \small{5}      \\
2601  \hline  \hline
2602  \small{4}     & \small{1}       & \small{4}        & \small{7}      \\  \small{4}     & \small{1}       & \small{4}        & \small{7}      \\
2603  \hline  \hline
2604  \small{5}     & \small{2}       & \small{11}       & \small{19}     \\  \small{5}     & \small{2}       & \small{11}       & \small{19}     \\
2605  \hline  \hline
2606  \small{6}     & \small{1}       & \small{15}       & \small{26}     \\  \small{6}     & \small{1}       & \small{15}       & \small{26}     \\
2607  \hline  \hline
2608  \small{7}     & \small{2}       & \small{41}       & \small{71}     \\  \small{7}     & \small{2}       & \small{41}       & \small{71}     \\
2609  \hline  \hline
2610  \small{8}     & \small{1}       & \small{56}       & \small{97}     \\  \small{8}     & \small{1}       & \small{56}       & \small{97}     \\
2611  \hline  \hline
2612  \small{9}     & \small{2}       & \small{153}      & \small{265}    \\  \small{9}     & \small{2}       & \small{153}      & \small{265}    \\
2613  \hline  \hline
2614  \end{tabular}  \end{tabular}
2615  \end{center}  \end{center}
2616  \end{table}  \end{table}
2617    
2618  Note from Table \ref{tbl:ex:ccfr0:scba0:bestratapptoirratnum2d}  Note from Table \ref{tbl:ex:ccfr0:scba0:bestratapptoirratnum2d}
2619  that the 8-th order convergent, $s_8 = 56/97$,  that the 8-th order convergent, $s_8 = 56/97$,
2620  is the highest-ordered convergent with $q_k \leq 100$, so  is the highest-ordered convergent with $q_k \leq 100$, so
2621  by Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}, 56/97  by Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors}, 56/97
2622  is one neighbor in $F_{100}$ to $1/\sqrt{3}$.  Because $s_8$  is one neighbor in $F_{100}$ to $1/\sqrt{3}$.  Because $s_8$
2623  is an even-ordered convergent, it will be the left  is an even-ordered convergent, it will be the left
2624  Farey neighbor.  Farey neighbor.
2625  By (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}), the  By (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}), the
2626  other Farey neighbor is 41/71, and it will be the right  other Farey neighbor is 41/71, and it will be the right
2627  Farey neighbor.  Taking the reciprocal of these neighbors (and  Farey neighbor.  Taking the reciprocal of these neighbors (and
2628  reversing their order) yields $97/56 < \sqrt{3} < 41/71$  reversing their order) yields $97/56 < \sqrt{3} < 41/71$
2629  as the two members of $F_{200, \overline{100}}$ which enclose  as the two members of $F_{200, \overline{100}}$ which enclose
2630  $\sqrt{3}$.  $\sqrt{3}$.
2631  \end{vworkexampleparsection}  \end{vworkexampleparsection}
2632  \vworkexamplefooter{}  \vworkexamplefooter{}
2633    
2634    
2635  A natural question to ask is whether, given only a \emph{single}  A natural question to ask is whether, given only a \emph{single}
2636  rational number $a/b \in F_N$, the apparatus of continued fractions  rational number $a/b \in F_N$, the apparatus of continued fractions
2637  can be used to economically find its neighbors in $F_N$.  Examining  can be used to economically find its neighbors in $F_N$.  Examining
2638  the proof of Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors},  the proof of Theorem \ref{thm:ccfr0:scba0:cfenclosingneighbors},
2639  we see that the entire proof applies even if the denominator of the  we see that the entire proof applies even if the denominator of the
2640  highest-order convergent, $q_n$, is less than or equal to $N$---that is,  highest-order convergent, $q_n$, is less than or equal to $N$---that is,
2641  the number specified by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})  the number specified by (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
2642  is a left or right Farey neighbor in $F_N$ of $a/b$.  If $n$ is even,  is a left or right Farey neighbor in $F_N$ of $a/b$.  If $n$ is even,
2643  $s_{n-1} > s_n$, and the number specified by  $s_{n-1} > s_n$, and the number specified by
2644  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) will be the right Farey neighbor  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) will be the right Farey neighbor
2645  of $s_n$, and  of $s_n$, and
2646  (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq03}) and  (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq03}) and
2647  (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq04})  (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq04})
2648  can be used to find the left Farey neighbor.  can be used to find the left Farey neighbor.
2649  On the other hand if $n$ odd, $s_{n-1} < s_n$, (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})  On the other hand if $n$ odd, $s_{n-1} < s_n$, (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
2650  will be the left Farey neighbor of $s_n$, and  will be the left Farey neighbor of $s_n$, and
2651  (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq01})  (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq01})
2652  and  and
2653  (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq02})  (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq02})
2654  can be used to find the  can be used to find the
2655  right Farey neighbor.  We summarize these observations as Algorithm  right Farey neighbor.  We summarize these observations as Algorithm
2656  \ref{alg:ccfr0:scba0:cffareyneighborfn}.  \ref{alg:ccfr0:scba0:cffareyneighborfn}.
2657    
2658  \begin{vworkalgorithmstatementpar}{Neighbors Of  \begin{vworkalgorithmstatementpar}{Neighbors Of
2659                                     \mbox{\boldmath $a/b \in F_N$}                                     \mbox{\boldmath $a/b \in F_N$}
2660                                     In \mbox{\boldmath $F_N$}}                                     In \mbox{\boldmath $F_N$}}
2661  \label{alg:ccfr0:scba0:cffareyneighborfn}  \label{alg:ccfr0:scba0:cffareyneighborfn}
2662  \end{vworkalgorithmstatementpar}  \end{vworkalgorithmstatementpar}
2663  \begin{alglvl0}  \begin{alglvl0}
2664    
2665  \item  Apply the first part of Algorithm  \item  Apply the first part of Algorithm
2666         \ref{alg:ccfr0:scba0:cfenclosingneighborsfn} to obtain         \ref{alg:ccfr0:scba0:cfenclosingneighborsfn} to obtain
2667             all of the partial quotients and convergents of $a/b$.             all of the partial quotients and convergents of $a/b$.
2668             The final convergent, $s_n = p_n/q_n$, will be             The final convergent, $s_n = p_n/q_n$, will be
2669             $a/b$ in reduced form.             $a/b$ in reduced form.
2670    
2671  \item  Use (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})  \item  Use (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
2672         (with $k = n$) to obtain the right Farey neighbor         (with $k = n$) to obtain the right Farey neighbor
2673             (if $n$ is even) or the left Farey neighbor (if $n$             (if $n$ is even) or the left Farey neighbor (if $n$
2674             is odd).             is odd).
2675    
2676  \item  If $n$ is even, $s_{n-1} > s_n$, and the number specified by  \item  If $n$ is even, $s_{n-1} > s_n$, and the number specified by
2677         (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) will be         (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) will be
2678             the right Farey neighbor of $s_n$.  Use             the right Farey neighbor of $s_n$.  Use
2679         (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq03}) and         (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq03}) and
2680         (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq04})         (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq04})
2681         to find the left Farey neighbor.         to find the left Farey neighbor.
2682         On the other hand if $n$ is odd, $s_{n-1} < s_n$,         On the other hand if $n$ is odd, $s_{n-1} < s_n$,
2683             (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})             (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01})
2684         will be the left Farey neighbor of $s_n$.  Use         will be the left Farey neighbor of $s_n$.  Use
2685         (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq01})         (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq01})
2686         and (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq02})         and (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq02})
2687         to find the right Farey neighbor.         to find the right Farey neighbor.
2688    
2689  \end{alglvl0}  \end{alglvl0}
2690  %\vworkalgorithmfooter{}  %\vworkalgorithmfooter{}
2691    
2692  \begin{vworkexamplestatement}  \begin{vworkexamplestatement}
2693  \label{ex:ccfr0:scba0:fnneighborsaoverbinfn}  \label{ex:ccfr0:scba0:fnneighborsaoverbinfn}
2694  Find the neighbors of 5/7 in $F_{1,000,000}$.  Find the neighbors of 5/7 in $F_{1,000,000}$.
2695  \end{vworkexamplestatement}  \end{vworkexamplestatement}
2696  \begin{vworkexampleparsection}{Solution}  \begin{vworkexampleparsection}{Solution}
2697  As per Algorithm \ref{alg:ccfr0:scba0:cffareyneighborfn}, the first  As per Algorithm \ref{alg:ccfr0:scba0:cffareyneighborfn}, the first
2698  step is to obtain the partial quotients and convergents of 5/7  step is to obtain the partial quotients and convergents of 5/7
2699  (these partial quotients and convergents are shown in  (these partial quotients and convergents are shown in
2700  Table \ref{tbl:ex:ccfr0:scba0:fnneighborsaoverbinfn}).  Table \ref{tbl:ex:ccfr0:scba0:fnneighborsaoverbinfn}).
2701    
2702  \begin{table}  \begin{table}
2703  \caption{Partial Quotients And Convergents Of 5/7  \caption{Partial Quotients And Convergents Of 5/7
2704                   (Example \ref{ex:ccfr0:scba0:fnneighborsaoverbinfn})}                   (Example \ref{ex:ccfr0:scba0:fnneighborsaoverbinfn})}
2705  \label{tbl:ex:ccfr0:scba0:fnneighborsaoverbinfn}  \label{tbl:ex:ccfr0:scba0:fnneighborsaoverbinfn}
2706  \begin{center}  \begin{center}
2707  \begin{tabular}{|c|c|c|c|c|c|c|}  \begin{tabular}{|c|c|c|c|c|c|c|}
2708  \hline  \hline
2709  \small{Index ($k$)} & \small{$dividend_k$}  & \small{$divisor_k$} & \small{$a_k$}   & \small{$remainder_k$} & \small{$p_k$}    & \small{$q_k$}  \\  \small{Index ($k$)} & \small{$dividend_k$}  & \small{$divisor_k$} & \small{$a_k$}   & \small{$remainder_k$} & \small{$p_k$}    & \small{$q_k$}  \\
2710  \hline  \hline
2711  \hline  \hline
2712  \small{-1}    & \small{N/A}           & \small{5}           & \small{N/A}     & \small{7}             & \small{1}        & \small{0}      \\  \small{-1}    & \small{N/A}           & \small{5}           & \small{N/A}     & \small{7}             & \small{1}        & \small{0}      \\
2713  \hline  \hline
2714  \small{0}     & \small{5}             & \small{7}           & \small{0}       & \small{5}             & \small{0}        & \small{1}      \\  \small{0}     & \small{5}             & \small{7}           & \small{0}       & \small{5}             & \small{0}        & \small{1}      \\
2715  \hline  \hline
2716  \small{1}     & \small{7}             & \small{5}           & \small{1}       & \small{2}             & \small{1}        & \small{1}      \\  \small{1}     & \small{7}             & \small{5}           & \small{1}       & \small{2}             & \small{1}        & \small{1}      \\
2717  \hline  \hline
2718  \small{2}     & \small{5}             & \small{2}           & \small{2}       & \small{1}             & \small{2}        & \small{3}      \\  \small{2}     & \small{5}             & \small{2}           & \small{2}       & \small{1}             & \small{2}        & \small{3}      \\
2719  \hline  \hline
2720  \small{3}     & \small{2}             & \small{1}           & \small{2}       & \small{0}             & \small{5}        & \small{7}      \\  \small{3}     & \small{2}             & \small{1}           & \small{2}       & \small{0}             & \small{5}        & \small{7}      \\
2721  \hline  \hline
2722  \end{tabular}  \end{tabular}
2723  \end{center}  \end{center}
2724  \end{table}  \end{table}
2725    
2726  Since the final convergent, $s_{3}$, is an odd-ordered convergent, $s_{k-1} < s_k$, and  Since the final convergent, $s_{3}$, is an odd-ordered convergent, $s_{k-1} < s_k$, and
2727  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) will supply the left Farey neighbor  (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) will supply the left Farey neighbor
2728  of 5/7.  Applying (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) with  of 5/7.  Applying (\ref{eq:ccfr0:scba0:thm:cfenclosingneighbors:01}) with
2729  $N=1,000,000$, $k=3$, $k-1=2$, $p_k = 5$, $q_k = 7$, $p_{k-1}=2$, and $q_{k-1}=3$  $N=1,000,000$, $k=3$, $k-1=2$, $p_k = 5$, $q_k = 7$, $p_{k-1}=2$, and $q_{k-1}=3$
2730  yields $\frac{714,282}{999,995}$ as the left Farey neighbor of 5/7 in $F_{1,000,000}$.  yields $\frac{714,282}{999,995}$ as the left Farey neighbor of 5/7 in $F_{1,000,000}$.
2731  Application of (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq01})  Application of (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq01})
2732  and (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq02})    and (\cfryzeroxrefhyphen{}\ref{eq:cfry0:sgfs0:thm:01:eq02})  
2733  yields $\frac{714,283}{999,996}$ as the right Farey neighbor.  yields $\frac{714,283}{999,996}$ as the right Farey neighbor.
2734  \end{vworkexampleparsection}  \end{vworkexampleparsection}
2735  %\vworkexamplefooter{}  %\vworkexamplefooter{}
2736    
2737    
2738  \begin{vworkalgorithmstatementpar}{Neighbors Of  \begin{vworkalgorithmstatementpar}{Neighbors Of
2739                                     \mbox{\boldmath $x \in F_{k_{MAX},\overline{h_{MAX}}}$}                                     \mbox{\boldmath $x \in F_{k_{MAX},\overline{h_{MAX}}}$}
2740                                     In \mbox{\boldmath $F_{k_{MAX},\overline{h_{MAX}}}$}}                                     In \mbox{\boldmath $F_{k_{MAX},\overline{h_{MAX}}}$}}
2741  \label{alg:ccfr0:scba0:cffareyneighborfab}  \label{alg:ccfr0:scba0:cffareyneighborfab}
2742  \begin{alglvl0}  \begin{alglvl0}
2743  \item If $a/b < h_{MAX}/k_{MAX}$, apply Algorithm  \item If $a/b < h_{MAX}/k_{MAX}$, apply Algorithm
2744        \ref{alg:ccfr0:scba0:cffareyneighborfn} directly;        \ref{alg:ccfr0:scba0:cffareyneighborfn} directly;
2745    
2746  \item Else if $a/b > h_{MAX}/k_{MAX}$, apply Algorithm  \item Else if $a/b > h_{MAX}/k_{MAX}$, apply Algorithm
2747        \ref{alg:ccfr0:scba0:cffareyneighborfn} using $b/a$ rather        \ref{alg:ccfr0:scba0:cffareyneighborfn} using $b/a$ rather
2748            than $a/b$ as the input to the algorithm, using $h_{MAX}$            than $a/b$ as the input to the algorithm, using $h_{MAX}$
2749            rather than $k_{MAX}$ as $N$, and            rather than $k_{MAX}$ as $N$, and
2750            using the reciprocals of the results of the algorithm.\footnote{The            using the reciprocals of the results of the algorithm.\footnote{The
2751            basis for taking the reciprocals of input and output and            basis for taking the reciprocals of input and output and
2752            using $h_{MAX}$ rather than $k_{MAX}$ are explained            using $h_{MAX}$ rather than $k_{MAX}$ are explained
2753            in \cfryzeroxrefcomma{}Section \ref{cfry0:schk0}.}            in \cfryzeroxrefcomma{}Section \ref{cfry0:schk0}.}
2754  \end{alglvl0}  \end{alglvl0}
2755  \end{vworkalgorithmstatementpar}  \end{vworkalgorithmstatementpar}
2756  \vworkalgorithmfooter{}  \vworkalgorithmfooter{}
2757    
2758    
2759  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2760  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2761  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2762  \section{The Stern-Brocot Tree}  \section{The Stern-Brocot Tree}
2763  %Section tag:  SBT0  %Section tag:  SBT0
2764  \label{ccfr0:ssbt0}  \label{ccfr0:ssbt0}
2765    
2766  In this chapter, we've developed continued fraction techniques of best  In this chapter, we've developed continued fraction techniques of best
2767  rational approximation without reference to any other models or theory.  rational approximation without reference to any other models or theory.
2768  Because the algorithms presented in this chapter are $O(log \; N)$,  Because the algorithms presented in this chapter are $O(log \; N)$,
2769  the results so far are completely satisfactory and usable in practice.  the results so far are completely satisfactory and usable in practice.
2770  It is not necessary to go further or to present additional information.  It is not necessary to go further or to present additional information.
2771    
2772  However, there is a second model of best rational approximation (and a second  However, there is a second model of best rational approximation (and a second
2773  set of algorithms), involving  set of algorithms), involving
2774  the Stern-Brocot tree.  In fact, when reviewing the material in this  the Stern-Brocot tree.  In fact, when reviewing the material in this
2775  chapter, some readers have inquired why the Stern-Brocot tree was not  chapter, some readers have inquired why the Stern-Brocot tree was not
2776  used.\footnote{In brief, the Stern-Brocot tree was not used because  used.\footnote{In brief, the Stern-Brocot tree was not used because
2777  the resulting algorithms are $O(N)$, and so will introduce practical  the resulting algorithms are $O(N)$, and so will introduce practical
2778  computational difficulties when used with large integers.}  In this  computational difficulties when used with large integers.}  In this
2779  section, we introduce the Stern-Brocot tree, demonstrate how to construct it,  section, we introduce the Stern-Brocot tree, demonstrate how to construct it,
2780  mention its major properties, show its correspondence with the apparatus of  mention its major properties, show its correspondence with the appar