0

Does there exist a prime $p$ such that $\gcd(p, 2^n+3^n+6^n-1)=1\forall n\ge 1 $?

That was from a math Olympiad in which I participated today. I didn’t solve the problem but I have one thing to say before presenting my approach. The phrasing of the problem confused me. I didn’t know which statement is true, typically when you see this type of questions you would probably think that the answer is NO, but the fact that the problem is hard so I thought the answer is YES and then I tried to find such $p$ but It also didn’t work.

Asumme $\exists p$ s.t. $\forall n\ge 1$, $d=\gcd(p,2^n+3^n+6^n-1)=1$. And note that $p\neq2$ because $2^n+3^n+6^n-1 $ is even and $p\neq3$ because $n=2$ is a counterexample. So $\gcd(2,p)=(3,p)=1$. Here I tried to construct a counterexample i.e. $\exists n$ s.t. $\forall p, d>1$ but I didn’t succeed constructing it.

PNT
  • 4,295
  • Hint: use Fermat's little theorem; there's a little subtlety, though. try taking $n=p-2$ and multiplying the whole thing through by $6$. Can you see how to use FLT to reduce the terms that you get that way? – Steven Stadnicki Feb 25 '22 at 18:28
  • 1
    Let the record show that @StevenStadnicki's comment beat my answer by 1 second :D – Greg Martin Feb 25 '22 at 18:30
  • 2
    Note: This is from IMO 2005. EG https://math.stackexchange.com/questions/2803320/imo-2005-no-4-all-integers-relatively-prime-to-terms-of-infinite-sequence – Calvin Lin Feb 25 '22 at 18:46

1 Answers1

6

This is a nice problem—there's a simple solution that's hard to come across, and it doesn't really fit a pattern of other similar problems.

The answer is indeed NO. The OP has already ruled out $p=2,3$, so assume that $p\ge5$. We claim that $n=p-2$ gives a nontrivial greatest common divisor, namely $\gcd(p,K)=p$ when $K=2^{p-2}+3^{p-2}+6^{p-2}-1$.

To see this, it suffices to show that $\gcd(p,6K)=p$ since we know $\gcd(p,6)=1$. But $$ 6K = 3\cdot 2^{p-1}+2\cdot 3^{p-1}+6^{p-1}-6 \equiv 3\cdot1+2\cdot1+1-6=0\pmod p $$ by three applications of Fermat's little theorem, since $\gcd(p,2)=\gcd(p,3)=\gcd(p,6)=1$.

Informally, $a^{p-1}\equiv1\pmod p$ means that $a^{p-2}\equiv\frac1a\pmod p$, and so $K$ is really $\frac12+\frac13+\frac16-1\pmod p$, if that explains the "coincidence". One might also note the pattern $n=p-2$ from trying several small primes $p$ individually.

Greg Martin
  • 92,241