Sum of atrocious numbers $p^n|(7^{p^n} + 1)$ where $p$ is prime

elementary-number-theory

Reviewing Fermat's Little Theorem, I came across a question on here in the applications portion of the article.

It states that a number $p^n$ is said to be atrocious if $p^n|(7^{p^n} + 1)$ where $p$ is prime. The goal is to find the sum of all atrocious numbers. The question doesn't quantify $n$, but I am assuming it is a positive integer.

Attempt

Fermat's Little theorem states for any prime $p$, for any integer $a$ that $a^p \equiv a \pmod{p}$.

Ok so suppose $p$ is a prime where $p^n$ is atrocious for some $n$, then $p|p^n$, and so $p|(7^{p^n} + 1)$. Then since $p$ is prime I want to write $7^{p^n} = (7^p)^{p^{n-1}} \equiv 7^{p^{n-1}} \pmod{p}$. Continuing on in this manner, you can show that $7^{p^n} \equiv 7 \pmod{p}$.

Any insights appreciated.

Best Answer

Well, first by the line of reasoning OP, $p$ has to divide $7+1$ so $p$ must be 2. Also, note the following: If $2^n|(7^{2^n} +1)$ for $n >3$ then $7^{2^n} \pmod 8 = -1$. But then $7 \pmod 8 =-1$ already and so $7^{2^n} \pmod 8 = 1$ for any $n \in \mathbb{N}$ [because the exponent $2^n$ is even for all $n \in \mathbb{N}$] so this is impossible for $2^n$ to divide $7^{2^n}$ for $n>3$, and one can check directly that it is impossible for $n=2$ as well . Thus $2^0=1, 2^1= 2$ can be the only atrocious numbers. So $1+2=3$.