TITLE: Prove that for any nonnegative integer n the number $5^{5^{n+1}} + 5^{5 ^n} + 1$ is not prime
QUESTION [17 upvotes]: My math teacher gave us problems to work on proofs, but this problem has been driving me crazy. I tried to factor or find patterns in the numbers and all I can come up with is that for $n > 0$, the number $\mod 100$ is $51$ but that does not help. There is definitely an easy way to do this but I can't think of it. Thanks if you can help

Prove that for any nonnegative integer $n$ the number $5^{5^{n+1}} + 5^{5^n} + 1$  is not prime.

REPLY [2 votes]: Here's a hint.
Let $a_n=5^{5^{n+1}}+5^{5^n}+1$.
Then, with some software, we can find that the smallest prime factor of $a_1$ and $a_2$ (at least...) is 31.
Can you show that 31 always divides $a_n$?