Maths WorkshopMaths problems with full solutions
Exercise 1119Number theory › PrimesL1Added 3 Nov 2026

Coprimality with factorials

#coprime#factorial#prime

Statement

Show that for n≥2n\ge2, gcd⁡(n,n!)=n\gcd(n,n!)=n and gcd⁡(n+1,n!)=1\gcd(n+1,n!)=1.

Hint

For the second, n+1n+1 and n!n! share no prime factor.

Show solutionHide solution

Solution

First. n∣n!n\mid n! since n≤nn\le n and n≥1n\ge1, so gcd⁡(n,n!)=n\gcd(n,n!)=n.

Second. Any prime p∣n!p\mid n! satisfies p≤np\le n, while any prime p∣n+1p\mid n+1 satisfies p≤n+1p\le n+1, but p=n+1p=n+1 is possible only if n+1n+1 is prime. If p=n+1p=n+1 prime, then p>np>n, so p∤n!p\nmid n!. If p≤np\le n, then p∣n!p\mid n! but pp cannot divide n+1n+1 unless p=1p=1.

Conclusion. gcd⁡(n,n!)=n\gcd(n,n!)=n, gcd⁡(n+1,n!)=1\gcd(n+1,n!)=1.