We’ve developed techniques to find one solution. Euclid’s algorithm gives us that Then, we can work backwards to find a solution to :
So and we multiply both sides by to get or in other words, that , gives a solution.
Now, you might wonder whether this is the only solution.
There’s a way of analysing this. Suppose we have two solutions: Subtracting, we get Dividing out by the greatest common divisor, we get or This means that, as divides the right-hand side, then we also have . But since and are coprime, we have by So we can write . But then we can solve to get , and it’s easy to check that any such works.
Hence the general solution is
While I haven’t stated (and certainly haven’t proved) any theorems about it, this approach works perfectly well in general, as you can imagine.
Common divisors and the gcd
Here’s a useful result about common divisors.
Let and be positive integers. Any common divisor of and is a divisor of the greatest common divisor.
If and , then for any . Hence is a divisor of the numbers obtained after every step of Euclid’s algorithm, and so it is a divisor of the gcd.
We defined the gcd to be the greatest of all common divisors. This property is arguably a more natural one: this says that the gcd is somehow the “best” common divisor.
As an unexpected advantage, if we think of the gcd as being defined in this way, then we can get that . This was undefined previously.
Repeatedly over the last few lectures (and the last few problem sheets) we have seen appearances of lots of things like:
remainders upon division;
numbers of the form or , and so on.
All these things look pretty similar, and it’s time we got ourselves a language for discussing these things better.