0

Find $\text{gcd}(2^{21}-1,2^{27}-1).$

My proof: We know that $2^{21}-1=(2^3)^7-1=8^7-1=(8-1)(8^6+\dots+8+1)=7(8^6+\dots+8+1)=7N_1$ and $2^{27}-1=(2^3)^9-1=8^9-1=(8-1)(8^8+\dots+8+1)=7(8^8+\dots+8+1)=7N_2.$ Also $N_2-N_1=8^8+8^7$. Hence $$\text{gcd}(2^{21}-1,2^{27}-1)=\text{gcd}(7N_1,7N_2)=7\text{gcd}(N_1,N_2).$$

I guess that $\text{gcd}(N_1,N_2)=1$ but I can't prove rigorously. Can anyone show a full proof?

RFZ
  • 16,814

1 Answers1

4

We know that $$\gcd(a^n-1,a^m-1)=a^{\gcd(n,m)}-1$$ So now $$\gcd(2^{21}-1,2^{27}-1)=2^{\gcd(21,27)}-1=7$$


We'll now prove the theorem I used here.

We can do the following. Assume $n>m$, then: \begin{align} \gcd(a^n-1,a^m-1)&=\gcd((a^n-1)-(a^m-1),a^m-1)\\ &=\gcd(a^m(a^{n-m}-1),a^m-1)\\ \end{align} since $\gcd(a^m,a^m-1)=1$, we now know $$\gcd(a^n-1,a^m-1)=\gcd(a^{n-m}-1,a^m-1)$$ Now we can do Euclid's algorithm in the exponents! We obtain the final equality$$\gcd(a^n-1,a^m-1)=a^{\gcd(n,m)}-1$$

  • +1! It's very nice resut and I didn't know about it. Can you give a proof or reference to proof? – RFZ Feb 03 '16 at 08:19
  • 1
    Edited the answer with a (in my opinion) quite elegant proof. –  Feb 03 '16 at 08:24
  • Nice proof! But can you explain the last sentence more deailed. What means "Now we can do Euclid's algorithm in the exponents"? – RFZ Feb 03 '16 at 08:27
  • Euclid's Algorithm is based of a very basic theorem. For all $a,b\in\mathbb{Z}$ (where $b\neq 0$), we can find $q,r\in\mathbb{Z}$ with $a=bq+r$, where $0\leq r<b$. Now if we wish to compute $\gcd(a,b)$, where $a>b$, then note that $\gcd(a,b)=\gcd(b,r)$, and so we can reduce further and further until we reach the $\gcd$. To obtain $\gcd(r,b)$ from $\gcd(a,b)$ we only have to use $\gcd(a,b)=\gcd(a-b,b)$ a couple times. Be aware of that this is no proof for anything, just a basic explaination of what the algorithm is. –  Feb 03 '16 at 08:35
  • Yes i know that! But how you got that $\text{gcd}(a^n-1,a^m-1)=a^{\text{gcd}(n,m)}-1$? – RFZ Feb 03 '16 at 09:36
  • Since $\gcd(a^n-1,a^m-1)=\gcd(a^{n-m}-1,a^m-1)$, we can repeat this process (doing euclid's algorithm in the exponents to get $\gcd(n,m)$) to get $\gcd(a^n-1,a^m-1)=a^{\gcd(n,m)}-1$. I advice you to try following my proof with the numbers in your problem, you'll understand it better that way. –  Feb 03 '16 at 09:43
  • Dear! Thank you very much for your elegant proof. Just now I understood what did you mean :) – RFZ Feb 03 '16 at 10:11