Find all prime numbers $p$ for which the natural number

$$
3^{p}+4^{p}+5^{p}+9^{p}-98
$$

has at most 6 positive divisors.
Note. You may use that 9049 is a prime number.
Answer: the only prime numbers for which this holds are 2, 3, and 5.
We write $f(p)=3^{p}+4^{p}+5^{p}+9^{p}-98$. Then we calculate the prime factorizations $f(2)=3 \cdot 11, f(3)=7 \cdot 11^{2}$ and $f(5)=7 \cdot 9049$. Thus, they have 4, 6, and 4 divisors, respectively. The number of divisors of $p_{1}^{e_{1}} p_{2}^{e_{2}} \cdots p_{n}^{e_{n}}$ is, after all, $\left(e_{1}+1\right)\left(e_{2}+1\right) \cdots\left(e_{n}+1\right)$.

Now suppose that $p>5$. Modulo 6, we then have only two possibilities for $p$, namely $p \equiv 1,-1 \bmod 6$, otherwise $p$ would have a factor 2 or 3. Fermat's little theorem tells us that $a^{6} \equiv 1 \bmod 7$ (as long as $a \not \equiv 0 \bmod 7$), so these two possibilities result in

$$
\begin{array}{r}
f(p) \equiv 3^{1}+4^{1}+5^{1}+9^{1}-98 \equiv 3+4+5+9+0 \equiv 0 \quad \bmod 7 \quad \begin{array}{c}
\text { if } p \equiv 1 \\
\bmod 6, \\
f(p) \equiv 3^{-1}+4^{-1}+5^{-1}+9^{-1}-98 \equiv 5+2+3+4+0 \equiv 0
\end{array} \quad \bmod 7
\end{array} \text { if } p \equiv-1 \quad \bmod 6 .
$$

The multiplicative inverses in the second line can be easily verified by multiplying them with the numbers in the row above. We conclude that $7 \mid f(p)$ for all $p>5$. Alternatively, modulo 7, $f(p) \equiv 3^{p}+(-3)^{p}+5^{p}+(-5)^{p}-0 \equiv 0$ for odd $p$.

Modulo 10, we have four possibilities for $p$, namely $p \equiv 1,3,-3,-1 \bmod 10$, otherwise $p$ would have a factor 2 or 5. Since $a^{10} \equiv 1 \bmod 11$ (as long as $a \not \equiv 0 \bmod 11$), these four possibilities result in

$$
\begin{array}{rrrrr}
3^{1}+4^{1}+5^{1}+9^{1}-98 \equiv 3+4+5+9+1 \equiv 0 & \bmod 11 & \text { if } p \equiv 1 & \bmod 10, \\
3^{3}+4^{3}+5^{3}+9^{3}-98 \equiv 5+9+4+3+1 \equiv 0 & \bmod 11 & \text { if } p \equiv 3 & \bmod 10, \\
3^{-3}+4^{-3}+5^{-3}+9^{-3}-98 \equiv 9+5+3+4+1 \equiv 0 & \bmod 11 & \text { if } p \equiv-3 & \bmod 10 \\
3^{-1}+4^{-1}+5^{-1}+9^{-1}-98 \equiv 4+3+9+5+1 \equiv 0 & \bmod 11 & \text { if } p \equiv-1 & \bmod 10
\end{array}
$$

For the second line, you just need to calculate the cubes, such as $5^{3}=125=$ $11 \cdot 11+4$. For the third and fourth lines, we can again easily find the multiplicative inverses. We conclude that $11 \mid f(p)$ for all $p>5$.

Now we note that for $p>5$ it holds that $f(p)>9^{5}=9 \cdot 81 \cdot 81>7 \cdot 11 \cdot 77$. So we can write $f(p)$ as $f(p)=7 \cdot 11 \cdot d$ with $d>77$. Then we have at least 8 different divisors, namely

$$
1<7<11<77<d<7 d<11 d<77 d
$$

So no prime number greater than 5 satisfies the condition.