Greatest common divisor · Exercise-GREATEST-COMMON-DIVISOR-006
Step-by-step solved exercise: Recurrences and arithmetic
Compute \(\displaystyle \gcd(1023,63)\), that is, \(\displaystyle \gcd(2^{10}-1,\,2^{6}-1)\).
Greatest common divisor · Exercise-GREATEST-COMMON-DIVISOR-006
Compute \(\displaystyle \gcd(1023,63)\), that is, \(\displaystyle \gcd(2^{10}-1,\,2^{6}-1)\).
Divide \(\displaystyle 1023\) by \(\displaystyle 63\) to get the remainder.
Since \(\displaystyle \gcd(a,b)=\gcd(b,r)\), the problem becomes \(\displaystyle \gcd(63,15)\).
Divide \(\displaystyle 63\) by \(\displaystyle 15\) to get the new remainder.
Since \(\displaystyle 15=5\cdot 3\), the remainder is \(\displaystyle 0\) and the last nonzero remainder is \(\displaystyle 3\). Therefore, \(\displaystyle \gcd(1023,63)=3\).
Comment: It matches \(\displaystyle 2^{\gcd(10,6)}-1=2^2-1=3\).
3