A prime number is a whole number greater than whose only positive divisors are and itself — equivalently, a number with exactly two distinct positive factors. is prime because none of divides it evenly. is not, because and divide it as well, giving it four factors: .
The primes below 100. There are exactly of them:
is the only even prime: every other even number is divisible by in addition to and itself, so it has at least three factors. Every prime after is therefore odd — but the converse fails badly, since , , and are all odd composites.
Why is not a prime number. This is the single most common point of confusion. has only one positive divisor — itself — not two, so it fails the definition outright. The deeper reason is the fundamental theorem of arithmetic: every integer greater than factors into primes in exactly one way, apart from the order of the factors. For example
If counted as prime, that uniqueness would collapse: , and so on without end. Excluding is precisely what makes "the prime factorisation" a well-defined object. Mathematicians classify separately as a unit.
Prime vs composite. A composite number is an integer greater than that is not prime: it has at least one divisor other than and itself, so it can be written as a product of two smaller positive integers. Every integer greater than is either prime or composite, never both. is neither prime nor composite, and and the negative integers fall outside the classification entirely.
How to test a small number. Trial division is enough by hand: divide by each prime in turn and stop once the trial divisor exceeds . The cut-off is valid because if with both factors larger than , their product would already exceed — so a composite number always has a factor at or below its square root.
Take . Since , you only need to test . None of them divides , so is prime.
Two shortcuts settle most cases quickly: a number is divisible by if its last digit is even, and by if its digits sum to a multiple of . That is why is not prime — is a multiple of , and indeed . The same trap catches and , both of which look prime at a glance. For larger inputs, the prime number checker runs the test and reports the divisor it finds.
There are infinitely many primes. Euclid proved this more than two thousand years ago. Suppose you had a finite list containing all the primes, and form
Dividing by any prime on the list leaves a remainder of , so none of them divides . But , so has at least one prime factor — and that factor cannot be on the list. No finite list can ever be complete. Note the careful wording: itself need not be prime. Using the first six primes, ; both of those primes were simply missing from the list.
Primes do thin out as numbers grow. The prime number theorem states that the count of primes below is approximately , so primes near occur with density roughly — sparser and sparser, but never exhausted.
Where primes matter. Prime factorisation is the machinery behind reducing fractions to lowest terms, computing greatest common divisors and least common multiples, and simplifying radicals. In computing, the difficulty of factoring a large number back into its primes is the security assumption underneath RSA encryption, and primes are used as moduli in hash tables and pseudorandom generators. The open questions about them — the twin prime conjecture, Goldbach's conjecture, the Riemann hypothesis — remain among the most famous unsolved problems in mathematics.