Skip to content

Do all prime numbers end in 1

GeneralClass 12AllAnswered 27 Mar 2026
Answer

No, prime numbers do not all end in 1—they can end in 1, 3, 7, or 9 (when looking at primes greater than 5). The only prime number ending in 2 is 2 itself, and the only prime ending in 5 is 5 itself. All other primes must end in 1, 3, 7, or 9 because numbers ending in 0, 2, 4, 6, or 8 are divisible by 2 (making them even and thus composite, except for 2), while numbers ending in 5 are divisible by 5 (making them composite, except for 5 itself).

This pattern emerges from basic divisibility rules: any number ending in an even digit or 5 (except 2 and 5 themselves) has an obvious factor and therefore cannot be prime. However, ending in 1, 3, 7, or 9 doesn't guarantee primality—plenty of composite numbers also end in these digits (like 9, 21, 27, 33, 49, 51, etc.). Primes are roughly evenly distributed among these four ending digits, though slight irregularities exist due to deeper number-theoretic patterns. For example, among smaller primes, there's no perfect balance, but as you examine larger and larger sets of primes, the distribution among 1, 3, 7, and 9 endings approaches uniformity. Understanding which digits primes can end with helps when testing numbers for primality, as you can immediately rule out any number ending in 0, 2, 4, 5, 6, or 8 (beyond the special cases of 2 and 5) without further calculation.

General · Class 12