Toolkit 79
Computing gcd(a,b)
Useful Properties
Use divisibility to simplify the numbers before applying the Euclidean algorithm whenever possible.
Example
Let .
Since , multiply by to obtain .
Since , multiply by to obtain .
Subtracting gives , so the only possibilities are or .
Finally, verify that each possible value is attainable by finding an appropriate value of .
Examples: