退出

Can we say something about primes $p$ s.t. $p^p-2$ is prime?

数论 Math StackExchange 4 票 1 回答 118 浏览 提问者: Manatee Pink 2026-08-04 12:39
number-theory prime-numbers

问题内容

So far I have found that 2 and 7 are such primes. However, due to the exponential form, I can't compute very far for more examples (currently, get stuck at 19).

More specifically, I want to know whether there exists a finite or infinite amount of these primes.

I am not well versed in number theory, so any help, any direction pointed to would be much appreciated.

I tried to apply Wilson's theorem, but the expressions involved are quite complex and I have exactly zero ideas how to proceed after substituting in.

I also had the idea that maybe if $p$ and $p^p-2$ are prime, maybe $$(p^p-2)^{p^p-2}-2$$ is prime again? Because then by induction and the base case 7, we would generate an infinite sequence of such primes. But again, the expression is so complicated, I don't even know where to start there.

回答 (1)

Lhachimi 1 票 2026-08-04 22:09 原文

a bit more detailed answer to,

I also had the idea that maybe if $p$ and $p^p-2$ are prime, maybe $$(p^p-2)^{p^p-2}-2$$ is prime again?

Let $p$ an odd prime s.t. $p^p-2$ is also prime, so $p\equiv -1 , 1 \pmod{3}$

If $p \equiv -1 \pmod{3}$, then $p^p \equiv (-1)^p \equiv -1 \pmod{3} $ (since $p$ is odd)

so $p^p-2 \equiv -1-2 \equiv 0 \pmod 3$ , but $p^p-2$ is an odd prime $\ge 3^3-2>3$

thus $p \equiv 1 \pmod{3}$, However $q=7^7-2=823541$ is prime

but $q\equiv -1 \pmod{3}$ so $q^q-2$ isn't prime anymore , hence $(7^7-2)^{7^7-2}-2$ is not prime !


In general, we can do similar elementary restrictions on odd $p$ by noticing that :

$$ 5 \mid p^p-2 \Leftrightarrow p \equiv 3,17 \pmod{20} $$

$$ 7 \mid p^p-2 \Leftrightarrow p \equiv 11,16 \pmod{21} $$

$$ 11 \mid p^p-2 \Leftrightarrow p \equiv 39,73,101,107 \pmod{110} $$

$$ 13 \mid p^p-2 \Leftrightarrow p \equiv 59,115,145,149 \pmod{156} $$

$$ 17 \mid p^p-2 \Leftrightarrow p \equiv 59,111,117,121 \pmod{136} $$

This can speed up research a little bit , but the main question right now is :

Can you find a prime $p>19$ s.t. $p^p-2$ is prime ?

However, we can pick $p>2500$ as Robert Price stated in A100408

Note that $2500$ research zone on $p$ is still very small , and so another small candidate $p$ might appear below $10^6$

but $2500^{2500} \approx 7.079811261 \times 10^{8494}$ , and so testing primality isn't that easy anymore 💀

I'd suspect only finite candidates to exist as @Dean Menezes explained heuristically :-)