On Euclid’s algorithm and elementary number theory

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 v...

Full description

Bibliographic Details
Main Authors: Backhouse, Roland, Ferreira, João F.
Format: Article
Published: Elsevier B.V. 2011
Subjects:
Online Access:https://eprints.nottingham.ac.uk/1856/
_version_ 1848790675279052800
author Backhouse, Roland
Ferreira, João F.
author_facet Backhouse, Roland
Ferreira, João F.
author_sort Backhouse, Roland
building Nottingham Research Data Repository
collection Online Access
description 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.
first_indexed 2025-11-14T18:16:23Z
format Article
id nottingham-1856
institution University of Nottingham Malaysia Campus
institution_category Local University
last_indexed 2025-11-14T18:16:23Z
publishDate 2011
publisher Elsevier B.V.
recordtype eprints
repository_type Digital Repository
spelling nottingham-18562020-05-04T16:30:17Z https://eprints.nottingham.ac.uk/1856/ On Euclid’s algorithm and elementary number theory Backhouse, Roland Ferreira, João F. 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. Elsevier B.V. 2011-03-01 Article NonPeerReviewed Backhouse, Roland and Ferreira, João F. (2011) On Euclid’s algorithm and elementary number theory. Science of Computer Programming, 76 (3). pp. 160-180. ISSN 0167-64230 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 algorithm; Rational number http://dx.doi.org/10.1016/j.scico.2010.05.006 doi:10.1016/j.scico.2010.05.006 doi:10.1016/j.scico.2010.05.006
spellingShingle 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 algorithm; Rational number
Backhouse, Roland
Ferreira, João F.
On Euclid’s algorithm and elementary number theory
title On Euclid’s algorithm and elementary number theory
title_full On Euclid’s algorithm and elementary number theory
title_fullStr On Euclid’s algorithm and elementary number theory
title_full_unstemmed On Euclid’s algorithm and elementary number theory
title_short On Euclid’s algorithm and elementary number theory
title_sort on euclid’s algorithm and elementary number theory
topic 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 algorithm; Rational number
url https://eprints.nottingham.ac.uk/1856/
https://eprints.nottingham.ac.uk/1856/
https://eprints.nottingham.ac.uk/1856/