Question: We want to find all $n\in \mathbb{Z}^+$ such that $7|5^{6n}+5^n+2$.
Answer: We have that $7|5^{6n}+5^n+2 \iff 5^{6n}+5^n+2 \equiv 0 \bmod 7$.
But $\phi(7)=6\wedge\text{gcd}(5,7)=1$ and we can apply Fermat's theorem, so $5^6 \equiv1 \bmod 7\implies 5^{6n}\equiv1 \bmod 7 $. So, we have to find all positive integers $n$ such that $$5^n+3\equiv0 \bmod 7 \iff 5^n \equiv 4 \bmod 7 \iff 2\cdot 5^n\equiv1 \bmod 7$$
I stuck in this point. Any help please?
Thank you in advance.