 Authors

Roland Backhouse and João F. Ferreira
 Downloads

 Paper: PDF (preprint)
 A short program written in Haskell that implements some of the algorithms discussed in the paper. There is also a program that searches for occurrences of the Eisenstein array on OEIS.
 Achille Brocot's original paper "Calcul des rouages par approximation, nouvelle methode", published in 1861 in "Revue Chronometrique. Journal des horlogers, scientifique et pratique" is available through Google books! You can read the journal or you can download it as a PDF (Brocot's paper goes from page 208 to 216 of the PDF file)
 Status

Published in the journal Science of Computer Programming (Vol. 76, No. 3, Pages 160180, Year 2011).
 Abstract

Algorithms can be used to prove and to discover new theorems. This paper shows how algorithmic skills in general, and the notion of invariance in particular, can be used to derive many results from Euclid's algorithm. We illustrate how to use the algorithm as a verification interface (i.e., how to verify theorems) and as a construction interface (i.e., how to investigate and derive new theorems).
The theorems that we verify are wellknown and most of them are included in standard numbertheory books. The new results concern distributivity properties of the greatest common divisor and a new algorithm for efficiently enumerating the positive rationals in two different ways. One way is known and is due to Moshe Newman. The second is new and corresponds to a deforestation of the SternBrocot tree of rationals. We show that both enumerations stem from the same simple algorithm. In this way, we construct a SternBrocot enumeration algorithm with the same time and space complexity as Newman's algorithm. A short review of the original papers by Stern and Brocot is also included.
 Keywords

number theory, calculational method, greatest common divisor, Euclid's algorithm, invariant, Eisenstein array, EisensteinStern tree (aka CalkinWilf tree), SternBrocot tree, algorithm derivation, enumeration algorithm, rational number
 Bibtex entry

@article{jff*11:euclidalg, author = {Roland Carl Backhouse and Jo{\~a}o F. Ferreira}, title = {On Euclid's algorithm and elementary number theory}, journal = {Sci. Comput. Program.}, volume = {76}, number = {3}, year = {2011}, pages = {160180}, url = {http://joaoff.com/publications/2011/euclidalg} }
 Related

 Our MPC 2008 paper: Recounting the Rationals: Twice!
 JFF0: Distributivity and the greatest common divisor
 Multiples in the Fibonacci series illustrates the use of the property that the Fibonacci function distributes over the greatest common divisor
 History

 17 March 2010 — uploaded the preprint version, subject to editorial changes
 21 December 2009 — notification of acceptance
 03 March 2009 — submitted the paper for publication
 24 February 2009 — uploaded the revised version of the paper (added section 6.5)
 20 February 2009 — uploaded the first version of the paper
On Euclid's Algorithm and Elementary Number Theory
[ CiteULike link ]