Elementary Number Theory – Showing $\gcd(2^m-1,2^n+1)=1$

divisibilityelementary-number-theorygcd-and-lcm

A student of mine has been self-studying some elementary number theory. She came by my office today and asked if I had any hints on how to prove the statement

If $m$ is odd then $\gcd(2^m-1,2^n+1)=1$.

It's been a while since I took number theory and I'm not sure what to do. She said she is learning about congruences, primitive roots, and power residues. She has not taken any group theory.

Best Answer

If an odd prime $p$ divides $2^n+1$, then the order of $2$ modulo $p$ is even (it is a divisor of $2n$, but not of $n$). If an odd prime $q$ divides $2^m-1$ with $m$ odd, then the order of $2$ modulo $q$ is odd (it is a divisor of $m$). Hence $p \neq q$. Since $2^m - 1$ is odd for $m > 0$, in particular all odd $m$, the greatest common divisor cannot be even. So no prime divides both, $2^n+1$ and $2^m-1$.

Alternatively, we can use

$$\gcd (2^t-1, 2^u-1) = 2^{\gcd (t,u)}-1\tag{1}$$

to conclude

$$\gcd (2^m-1, 2^{2n}-1) = 2^{\gcd(m,2n)}-1.$$

But since $m$ is odd, we have $\gcd (m,2n) = \gcd(m,n)$, and hence

$$2^{\gcd(m,2n)}-1 \mid 2^n-1,$$

which, since

$$\gcd(2^n-1,2^n+1) = \gcd(2^n-1,2) \mid 2$$

and $2^{\gcd(m,2n)}-1$ is odd, implies $\gcd (2^{\gcd(m,2n)}-1,2^n+1) = 1$ and hence $\gcd(2^m-1,2^n+1) = 1$.

To see $(1)$, write $u = q\cdot t + r$ with $0 \leqslant r < t$, and

$$2^u-1 = 2^r\left(2^{q\cdot t}-1\right) + \left(2^r-1\right),$$

which, since $2^t-1 \mid (2^t)^q-1$, yields

$$\gcd(2^t-1,2^u-1) = \gcd(2^t-1,2^r-1),$$

and continuing the Euclidean algorithm for the exponents finally yields $(1)$.

Related Question