Factorial primes are primes of the form $n!\pm1$. (In this application I'm interested specifically in $n!+1$ but any answer is likely to apply to both forms.) It seems hard to prove that there are infinitely many primes of this form, though Caldwell & Gallot were courageous enough to conjecture that there are infinitely many and to give a conjectured density ($e^\gamma\log x$ below $x$).

I'm looking at the opposite direction: how many composites are there of the form $n!\pm1$? It seems 'obvious' that the fraction of numbers of this form which are composite is 1, but I cannot even prove that there are infinitely many composites of this form.

Has this been proved? (Perhaps there's even a proof easy enough to relate here?) Or on the other hand, is it known to be open?


Wilson's Theorem shows there are infinitely many composites. For if $p$ is prime, then $(p-1)!+1$ is divisible by $p$, and apart from the cases $p=2$ and $p=3$, the number $(p-1)!+1$ is greater than $p$.

There are related ways to produce a composite. For example, let $p$ be a prime of the form $4k+3$. Then one of $\left(\frac{p-1}{2}\right)!\pm 1$ is divisible by $p$.

  • $\begingroup$ Great. Do you think this can be expanded to show that the density of composites is positive? $\endgroup$ – Charles Apr 19 '13 at 18:31
  • $\begingroup$ The game with $4k+3$ can be extended, using the Dirichlet Theorem on primes in arithmetic progressions. But that still only produces a very thin set, undoubtedly very far from the truth. $\endgroup$ – André Nicolas Apr 19 '13 at 18:36
  • $\begingroup$ I don't understand how $p|\left(\frac{p-1}{2}\right)!$? Is it supposed to be $p|\left(\frac{p-1}{2}\right)!-1$? $\endgroup$ – Inceptio Apr 20 '13 at 9:37
  • 1
    $\begingroup$ Thanks for noticing the typo. A $\pm $ was left out, and for clarity I added "one of." $\endgroup$ – André Nicolas Apr 20 '13 at 9:53
  • $\begingroup$ @AndréNicolas: Your welcome. But still it doesn't prove for which primes $\left(\frac{p-1}{2}\right)!- 1$ is divisible by $p$. Its a more harder problem.(As discussed in the link I've posted) $\endgroup$ – Inceptio Apr 21 '13 at 8:34

Wilson's theorem:

$(p-1)! \equiv -1 \mod p$

Wilson's theorem can be used for finding infinite values for $n!+1$ being composite.

For the second set of numbers(i.e $n!-1$).Very famous conjecture was given by Louis J Mordell for the values of $p$ which satisfies $(\dfrac{p-1}{2})! \equiv 1 \mod p$ . About which you can read here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.