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

Prime gaps

#prime gaps#arbitrary gaps#construction

Statement

Show that for any n≥1n\ge1, there exist nn consecutive composite integers.

Hint

Consider (n+1)!+2,…,(n+1)!+n+1(n+1)!+2,\ldots,(n+1)!+n+1.

Show solutionHide solution

Solution

Construction. Let N=(n+1)!N=(n+1)!. Then for k=2,…,n+1k=2,\ldots,n+1:
N+k=k⋅(n+1)!k+k=k((n+1)!k+1).N+k=k\cdot\frac{(n+1)!}{k}+k=k\left(\frac{(n+1)!}{k}+1\right).
Since kk divides (n+1)!(n+1)! and k≥2k\ge2, N+kN+k is composite.

Count. There are nn consecutive composite numbers N+2,…,N+n+1N+2,\ldots,N+n+1.

Conclusion. The gaps between consecutive primes can be arbitrarily large.