# How Wilson's theorem implies the existence of an infinitude of composite numbers of the form $n! + 1$?

This is a paragraph in David M. Burton, "elementary number theory, seventh edition:

": But I do not understand:

1- How Wilson's theorem implies the existence of an infinitude of composite numbers of the form $$n! + 1$$?

This is the statement of Wilson's theorem that I know:

$$P$$ is a prime iff $$(p-1)! \equiv -1 (mod p)$$

Could anyone explain this for me please?

2- I do not understand the second statement in the paragraph, especially in comparison to the first statement, does they mean that the form $$n! +1$$ can give us prime and composite numbers ?

• if $p>3$ is prime, then $(p-1)!+1$ is composite May 24 '19 at 3:11
• Because by Wilson: $(p-1)!\equiv -1\pmod{p}$, and thus, for every prime $p$, $p\mid (p-1)!+1$. Now, since $(p-1)! \geqslant 2^{p-2}$, it is not hard to see that for sufficiently large $p$, $(p-1)!+1>p$, thus, it is a positive integer, being larger than $p$ and divisible by $p$, has to be composite.
– TBTD
May 24 '19 at 14:43

Wilson's Theorem says that if $$p$$ is prime, then $$p$$ divides the number $$m:=(p-1)!+1$$. Since clearly $$p < m$$ if $$p>3$$, it follows that $$m$$ is composite.
1) this follows if you also use Euclid's result that there are infinitely many primes, as $$(p-1)!+1$$ will be composite for each such prime $$p$$.
2) Indeed, this implies that while we are sure there are infinitely many $$n$$ such that $$n!+1$$ is composite, we don’t know if there are infinitely many $$n$$ for which it’s prime. In other words if $$n-1$$ is not prime, this doesn’t necessarily imply that $$n!+1$$ is prime.
• why you are chosoing $n-1$ exactly that should be not prime? May 24 '19 at 8:33