Let $N = 5(n!)^2 -1$. Prove there is a prime $p$ that divides $N$ and $p \equiv -1$ mod $5$.

Let $$N = 5(n!)^2 -1$$ for some $$n \in \mathbb{N}$$. Prove there is a prime $$p$$ such that $$p$$ divides $$N$$ and $$p \equiv -1$$ mod $$5$$.

My work so far is to first take a prime $$p$$ that divides $$N$$. Then $$5(n!)^2 \equiv 1$$ mod $$p$$ and hence $$5 \equiv ((n!)^{-1})^2$$ mod $$p$$. So $$\left( \frac{5}{p}\right) = 1$$. But $$\left( \frac{5}{p}\right) = \left( \frac{p}{5}\right)$$ so $$p \equiv 1$$ mod 5 or $$p \equiv 4 \equiv -1$$ mod 5.

Not sure where to go from here. My goal ultimately is to show there are infinitely many primes that satisfy $$p \equiv -1$$ mod 5, using this $$N$$ as a helper. I don't know how to do this.

Thank you.

• Hint: $N\equiv-1\pmod 5$, so not all prime factors of $N$ can be $\equiv1\pmod 5$. – Jyrki Lahtonen Apr 4 at 14:23
• Just a nitpick, but if n=1, then N=4 which only has 2 as a divisor. Presumably for all n>2? – Chris Moorhead Apr 4 at 14:27