Maths WorkshopMaths problems with full solutions
Exercise 553Number theory › PrimesHigh schoolAdded 3 Nov 2026

Smallest prime divisor

#smallest divisor#compositeness#sqrt bound

Statement

Show that if n>1n>1 is composite, then nn has a prime divisor p≤np\le\sqrt n.

Hint

Write n=abn=ab with 1<a≤b<n1<a\le b<n. Then a≤na\le\sqrt n.

Show solutionHide solution

Solution

Factorization. n=abn=ab with 1<a≤b<n1<a\le b<n.

Bound. If a>na>\sqrt n, then b≥a>nb\ge a>\sqrt n, so ab>nab>n, contradiction. So a≤na\le\sqrt n.

Prime divisor. Any prime divisor pp of aa satisfies p≤a≤np\le a\le\sqrt n.

Conclusion. To test primality of nn, it suffices to test divisibility by primes up to n\sqrt n.