Greatest common divisor
From Algorithmist
The greatest common divisor of two numbers, x and y is the biggest integer that divides both x and y.
This comes in handy when calculating the least common multiple, since
.
The gcd can be found by using the Euclidean algorithm.
[edit] Some properties of the gcd
- Any number that divides both a and b divides gcd(a,b).
- gcd(a,b) is expressible as ax + by for some integers x and y(Extended Euclidean algorithm).
- More generally, the equation ax + by = c has integer solutions for x and y if and only if
. If it has one solution (x0,y0), it has infinitely many solutions, all given by
as t takes on all integer values.

