Let $n$ be a positive integer. Show that if $p$ is a prime dividing $1-5^n+5^{2n}-5^{3n}+5^{4n}$, then $p\equiv 1 \pmod{4}$.
Here is what I have tried: let $r=-5^n$, then $1-5^n+5^{2n}-5^{3n}+5^{4n}=1+r+r^2+r^3+r^4=\frac{1-r^5}{1-r}$. Hence $ord_p(1-r^5)-ord_p(1-r)>0.$ Now clearly $p\not= 2,5$, so $5^{(p-1)/2}\equiv -1\pmod{p}$. So $ord_p(1-r)=ord_p(1+5^n) | (p-1)/2$.
Similarly, $1-r^5=1+5^{5n}$ and $(5^{5n})^{(p-1)/2}\equiv -1 \pmod{p}$ but then I don't know how to make of that.
I see that this problem is about $p\equiv 1 \pmod{4}$ so I thought it might have something to do with the Gaussian integers $\mathbb{Z}[i]$ but I am not sure how the theory of gaussian integers helps in this case. And the number $5$ and the exponent $4$ seem suspicious, can we generalize it and replace them with other prime $q$ and $q-1$?
Thanks in advance.