Maths WorkshopMaths problems with full solutions
Exercise 1134Number theory › PrimesOlympiadAdded 3 Nov 2026

Primes and factorials

#factorial#primes#Wilson

Statement

Show that n!+1n!+1 is not divisible by any prime ≤n\le n.

Hint

For prime p≤np\le n: p∣n!p\mid n!, and if p∣n!+1p\mid n!+1, then p∣1p\mid1.

Show solutionHide solution

Solution

Setup. Let pp be prime with p≤np\le n. Then pp appears in the product n!=1⋅2⋯nn!=1\cdot2\cdots n, so p∣n!p\mid n!.

Suppose p∣n!+1p\mid n!+1. Then p∣(n!+1)−n!=1p\mid(n!+1)-n!=1, contradiction.

Conclusion. All prime divisors of n!+1n!+1 are >n>n.

Application. This gives Euclid-style proofs that infinitely many primes exist: n!+1n!+1 has a prime divisor >n>n.