Greatest Common Divisor

The well-known algorithm for finding the GCD of 2 numbers is attributed to Euclid around 300 BC but was almost certainly known before then. Given two numbers such as 90 and 24 what is their greatest common divisor? Can you figure out a way to find it?

You may be able to do it in your head from knowledge of multiplication tables or by trial and error. However, these methods would not work for larger numbers. What we need is a method that will produce the answer reliably for any pair of numbers. (Some pairs may have no gcd other than 1, a result which is not seen as particularly useful or interesting.)

The solution requires nothing more than simple arithmetic. There are two well-known solutions, one you may find for yourselves, the other more subtle and less obvious but equally simple when you find it.

Back