Prime numbers are whole numbers greater than one that can only be divided evenly by one and themselves. If you try to divide a prime number by any other integer, you'll always end up with a remainder or a fraction.
These numbers serve as the indivisible atoms of arithmetic. Every integer greater than one is either a prime number itself or can be built by multiplying prime numbers together. Understanding how they work unlocks the core rules of number theory, cryptography, and modern data security.
What Defines a Prime Number
To be classified as a prime number, an integer must satisfy three strict conditions:
- It must be a whole number (an integer).
- It must be strictly greater than one.
- Its only positive divisors must be one and itself.
The number one is excluded from the prime family. It's considered a unit rather than a prime or composite number because it doesn't have two distinct positive divisors.
Composite numbers are the direct opposite of primes. They are positive integers greater than one that have more than two divisors. For example, six is composite because it can be divided evenly by one, two, three, and six.
The Fundamental Theorem of Arithmetic
Every composite number has a unique recipe of prime numbers. This foundational principle is known as the Fundamental Theorem of Arithmetic. No matter how large a composite number is, it breaks down into one single, unique set of prime factors.
Take the number 60 as an example. You can factor it into 6 and 10. Breaking those down further gives you 2, 3, 2, and 5. Written in exponential form, the prime factorization of 60 is:
$$60 = 2^2 \times 3 \times 1^1 \times 5^1$$
No matter what factoring path you take—whether you start with 4 and 15 or 5 and 12—you will always arrive at the exact same prime building blocks: two 2s, one 3, and one 5. This absolute reliability is why mathematicians call primes the building blocks of mathematics.
How to Test if a Number Is Prime
When checking whether a small number is prime, you can use trial division. You test division by prime numbers starting from two up to the square root of your target number. If none of those primes divide evenly into your target, the number is prime.
Imagine you want to check if 97 is prime.
- First, find the approximate square root of 97, which is around 9.8.
- Next, test prime numbers up to that square root: 2, 3, 5, and 7.
- 97 isn't divisible by 2 (it's odd), 3 (the digits add to 16, which isn't divisible by 3), 5 (it doesn't end in 0 or 5), or 7 ($97 \div 7 = 13$ with a remainder of 6).
Because none of those prime numbers divide evenly into 97, 97 is a prime number.
The Infinite Sequence of Primes
Ancient mathematicians wondered if the list of prime numbers ever stopped or if it stretched on forever. Around 300 BCE, the Greek mathematician Euclid proved that primes are infinite.
Euclid's proof uses a clever logical contradiction. Suppose there is a finite list of all prime numbers. If you multiply every prime on that list together and add one to the result, you get a new number. That new number either must be prime itself or divisible by a prime not on your original list. Either way, the original list cannot be complete.
You can explore historical and mathematical proofs in detail through the Clay Mathematics Institute resources on number theory.
Prime Numbers in Modern Cryptography
Prime numbers do much more than sit in math textbooks; they protect your everyday digital life. Modern internet security relies heavily on the asymmetry of multiplication and factorization.
When you shop online or log into a secure website, your browser uses public-key cryptography—often the RSA algorithm. This encryption system multiplies two massive prime numbers together (each hundreds of digits long) to create a public key.
Multiplying two giant primes takes a standard computer a fraction of a second. However, taking the resulting massive product and figuring out which two original primes created it is computationally impossible for classical computers within any practical timeframe. This mathematical one-way street keeps credit card numbers, passwords, and private messages safe. You can read more about cryptographic standards from the National Institute of Standards and Technology.
Frequently Asked Questions
Is the number 2 a prime number?
Yes, 2 is the smallest prime number and the only even prime number. It's prime because its only positive divisors are 1 and 2. All other even numbers can be divided by 2, making them composite.
Why is the number 1 not prime?
The number 1 is not prime because it only has one distinct positive divisor (itself), whereas the definition of a prime number requires exactly two distinct positive divisors.
What are twin primes?
Twin primes are pairs of prime numbers that have a difference of two. Examples include 3 and 5, 11 and 13, and 17 and 19. Mathematicians still study whether an infinite number of twin prime pairs exist.
How many prime numbers are there?
There are infinitely many prime numbers. Euclid proved this mathematical reality over two thousand years ago, and modern supercomputers continue to discover larger prime numbers every year.