Why is $\gcd(2^p + 1,3^p + 1) = 1$?

152 Views Asked by At

Let $p$ be an odd prime. Why is $\gcd(2^p + 1,3^p + 1) = 1$ ?

I tried using Fermat's little and $\gcd(a+b,a) = \gcd(a,b)$ but without success.

I can make a statistical argument that suggests there are only a finite number of solutions.

But I do not like to use statistics in number theory. It has a bad reputation. ( example naive probably for Fermat primes vs Mersenne primes ).

I also had the impression

$$\gcd(2^{5n} + 1,3^{5n} + 1) = 1$$

For most positive integers $n$.

Im not sure if it helps but we can remove a few factors to arrive at

$$\gcd(\frac{2^p + 1}{3},\frac{3^p + 1}{4}) = 1$$

Would using p-adics help ?

Would it have value as an additional primality test in combination with Fermat's primality test ?

1

There are 1 best solutions below

5
On BEST ANSWER

A CAS tells me $$\gcd(2^{83}+1,3^{83}+1)=499$$ So the claim is false. It happens to be true for many primes $p$, but that is just because of the abundance of possible divisors available for large numbers like $2^{p}+1$ and $3^{p}+1$, and the consequent unlikelihood of an overlap. And yet it's not impossible to have overlap, as with $p=83$.

(Looks like @rogerl beat me to the counter example in the comments.)


This Sage code lists all the primes less than the $N$th prime where the $\gcd$ is larger than $1$:

N=1000
for k in range(N):
    if (gcd(2^Primes().unrank(k)+1,3^Primes().unrank(k)+1) != 1):
        print(Primes().unrank(k))

You can enter this here, for instance: https://sagecell.sagemath.org