# Show that there is an odd prime number>n divide $(n!)^2+1$ [duplicate]

Let $$n>1$$ and $$a_n=(n!)^2+1$$, Show that there is an odd prime number $$p>n$$ such that $$p \mid a_n$$

my attempt: if $$p>n$$ then $$p-1 \geq n$$ and so $$(p-1)!=(p-1)(p-2)...n!$$, and i tried to use Wilson's theorem which says that $$(p-1)!=-1$$ $$[p]$$, but it seems to be a closed door.

• $a_n$ is trivially odd. $a_n$ is trivially coprime with every prime $≤n$.
– lulu
Commented Apr 4, 2022 at 1:00

HINT: $$2$$ does not divide $$(n!)^2+1$$ [because it is an odd number]. Meanwhile neither does any other integer $$k \in \{3,\ldots, n \}$$ [because $$(n!)^2+1 \pmod k$$ $$= 1$$ for each such $$k$$].
So $$(n!)^2+1$$ has no divisors $$2$$ through $$n$$, including no prime divisors $$2$$ through $$n$$. What can you conclude about then the prime divisors of $$(n!)^2+1$$?
• i see it now, we know that the smallest divisor of any number $\geq$2 is a prime number, so we conclude that the first divisor >n is the prime we are looking for Commented Apr 4, 2022 at 1:09
• @HiddaWalid it is also possible for $a_n$ itself to be prime; indeed, $a_1,a_2,a_3,a_4,a_5$ are primes $2, 5, 37, 577, 14401.$ We finally get composite for $a_6 = 518401 = 13 \cdot 39877 ,$ next $a_7= 25401601 = 101 \cdot 251501$ Alright, $a_9$ is prime again. Commented Apr 4, 2022 at 1:47