The Euclidean Algorithm

In this chapter the author presents and analyzes an algorithm used to calculate the greatest common divisor of two given numbers in a very clever and elegant way. This algorithm was known already in the ancient world, and it is still used today in different variants – for example, public-key cryptography relies on the fact that the greatest common divisor of two numbers can be efficiently computed.