Skip to main content

Research Repository

See what's under the surface

On Euclid’s algorithm and elementary number theory

Backhouse, Roland; Ferreira, João F.

Authors

Roland Backhouse roland.backhouse@nottingham.ac.uk

João F. Ferreira João Ferreira



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 well-known and most of them are included in standard number-theory 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 Stern–Brocot tree of rationals. We show that both enumerations stem from the same simple algorithm. In this way, we construct a Stern–Brocot 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.

Journal Article Type Article
Publication Date Mar 1, 2011
Journal Science of Computer Programming
Print ISSN 0167-6423
Electronic ISSN 0167-64230
Publisher Elsevier
Peer Reviewed Not Peer Reviewed
Volume 76
Issue 3
Institution Citation Backhouse, R., & Ferreira, J. F. (2011). On Euclid’s algorithm and elementary number theory. Science of Computer Programming, 76(3), doi:10.1016/j.scico.2010.05.006
DOI https://doi.org/10.1016/j.scico.2010.05.006
Keywords Number theory;
Calculational method;
Greatest common divisor;
Euclid’s algorithm;
Invariant;
Eisenstein array;
Eisenstein–Stern tree (aka Calkin–Wilf tree);
Stern–Brocot tree;
Algorithm derivation;
Enumeration
Publisher URL http://dx.doi.org/10.1016/j.scico.2010.05.006
Copyright Statement Copyright information regarding this work can be found at the following address: http://eprints.nottingh.../end_user_agreement.pdf

Files

scp-rationals.pdf (315 Kb)
PDF

Copyright Statement
Copyright information regarding this work can be found at the following address: http://eprints.nottingham.ac.uk/end_user_agreement.pdf





Downloadable Citations