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)\).

Step by step with comments, a check and common mistakes.

Step-by-step solution

  1. Divide \(\displaystyle 1023\) by \(\displaystyle 63\) to get the remainder.

    \[\displaystyle 1023=16\cdot 63+15\]
  2. Since \(\displaystyle \gcd(a,b)=\gcd(b,r)\), the problem becomes \(\displaystyle \gcd(63,15)\).

    \[\displaystyle \gcd(1023,63)=\gcd(63,15)\]
  3. Divide \(\displaystyle 63\) by \(\displaystyle 15\) to get the new remainder.

    \[\displaystyle 63=4\cdot 15+3\]
  4. 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\).

    \[\displaystyle 15=5\cdot 3+0\quad\Rightarrow\quad \gcd(1023,63)=3\]

    Comment: It matches \(\displaystyle 2^{\gcd(10,6)}-1=2^2-1=3\).

Answer

3

🎯 Build my path to this exercise