What are the possible prime factors of $3^n+2$ , where $n$ is a positive integer?

Solution 1:

Just an observation not a complete answer. For a prime $p>3$, applying Fermat's little theorem $$2^p \equiv 2 \pmod{p}$$ and if there is a minimal $n_0 \in \mathbb{N}$ such that ($p$ - odd!): $$3^{n_0} \equiv -2 \pmod{p} \Rightarrow 3^{n_0\cdot p} \equiv (-2)^p \equiv -2 \pmod{p}$$ Also $n_0<p-1$, otherwise $n_0=(p-1)\cdot q + r, 0\leq r < p-1$ and $$3^{n_0}=3^{(p-1)\cdot q + r}=3^{(p-1)\cdot q}\cdot 3^{r}\equiv 3^r \equiv -2 \pmod{p}$$ since $3^{p-1}\equiv 1 \pmod{p}$. So, we can look for such mininal $n_0$ within $\{0,1,2,..,p-1\}$ range.

For example for

  • $p=5$, $n_0=1$ because $3 \equiv -2 \pmod{5} \Rightarrow 3^{5^k} \equiv -2 \pmod{5}$.
  • $p=7$, $n_0=5$ because $3^5 \equiv -2 \pmod{7} \Rightarrow 3^{5\cdot7^k} \equiv -2 \pmod{7}$.
  • $p=11$, $n_0=2$ because $3^2 \equiv -2 \pmod{11} \Rightarrow 3^{2\cdot11^k} \equiv -2 \pmod{11}$.
  • $p=13$ there is no such $n_0$

Solution 2:

COMMENT.-What I give here IS AN ANSWER. However I post it as a comment because maybe it is not as readers expect.

It is clear that $p\ne 2,3$ Let $p|(3^n+2)$ so one has in the prime field $\mathbb F_p$ the equality
$$3^n+2=0\iff3^n+3=1\iff3(3^{n-1}+1)=3^{p-1}\iff \color{red}{3^{n-1}+1=3^{p-2}}$$ In particular, $3$ must be the inverse of $3^{n-1}+1$ in the field $\mathbb F_p$ $$\text{ EXAMPLES}$$

$$►n=6\Rightarrow3^6+2=17\cdot43\Rightarrow3^{5}+1=244 =\begin{cases}6=3^{15}\text{ in }\mathbb F_{17}\\29=3^{41}\text{ in }\mathbb F_{43}\end{cases}$$

$$►n=12\Rightarrow3^{12}+2=11\cdot48313\Rightarrow3^{11}+1=177148 =\begin{cases}4=3^{9}\text{ in }\mathbb F_{11}\\32209=3^{48311}\text{ in }\mathbb F_{48313}\end{cases}$$

NOTE.-I have put $32209=3^{48311}\text{ in }\mathbb F_{48313}$ at the end only calculating $177148$ modulo the prime $48313$ getting $32209$ and giving by true (it should be true!) the equality.