PROJECT EULER · #0958
Euclid's Labour
The Euclidean algorithm can be used to find the greatest common divisor of two positive integers. At each step of the algorithm the smaller number is subtracted from the larger one. The algorithm terminates when the numbers are equal, which is then the greatest common divisor of the original numbers.
For two numbers
For a number
For example, at least four steps are needed for computing the GCD of
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.