When is $n!+1$ composite? I am trying to prove that if $n$ is composite then $n!+1$ is also composite.
But I can't. Please help.
If it is false then please give the number.
 A: A counterexample is the prime $27!+1$. Wolfram alpha claims this is prime and as you probably know, $27 = 3\cdot 3\cdot 3$.
A: A couple of people have mentioned Sloane's A002981, from which we can readily extract the counterexamples 27, 77, 116, 154, 320, 340, 399, 427, 872, 1477, 6380.
Also look at this FactorDB page: http://factordb.com/index.php?query=n!+%2B+1&use=n&n=1&VP=on&VC=on&EV=on&OD=on&PR=on&FF=on&PRP=on&CF=on&U=on&C=on&perpage=100&format=1&sent=Show Notice their codes: P means confirmed prime, PRP means probable prime, FF means fully factored composite number, CF means incompletely factored composite, C means composite without any known factors (could be the product of two or more large primes), and U is for unknown.
$27! + 1$ is a confirmed prime, as are $77! + 1$, $116! + 1$ and $154! + 1$. 
$114! + 1$ and $115! + 1$ are known to be composite but no nontrivial divisors are known. $122! + 1$ is divisible by 359. I don't see any probable primes or unknown status numbers below $200! + 1$.
Let's review Wilson's theorem. If, and only if, $p$ is prime, then $(p - 1)! + 1 \equiv -1 \mod p$. (The standard proof of Wilson's theorem can be found at http://primes.utm.edu/notes/proofs/Wilsons.html and plenty other places). So, if $p$ is an odd prime greater than 3, then $p - 1$ is composite, and correspondingly, $(p - 1)! + 1$ is composite, because it's divisible by $p$. That's why you don't see numbers like 28 or 30 or 36 in Sloane's A002981.
Of course this doesn't address composites that are not right below a prime. But it does give you a corollary to Wilson's theorem.
