Using $ \gcd(a,b) = \gcd(b,r) $ if $ a \equiv r \pmod b$ for GCD?

41 Views Asked by At

It should be true that $\gcd(a,b) = \gcd(b,r) $ if $ a \equiv r \pmod b$.

But: How can I use this equality to compute the GCD of $a$ and $b$?

It seems as if $r$ is of the form $r = k\cdot b + s$ where $s$ is the remainder we get from $a/b$