A prime number is a whole number greater than with exactly two positive divisors: and itself. So and are prime, is not prime, and numbers like are composite.
If a whole number greater than has more than two positive divisors, it is called composite. For example, is composite because it is divisible by and .
Prime Numbers Up To 50
Here are the prime numbers up to :
There is no simple repeating gap pattern. For example, and are close together, but the next gap from to is larger.
What Makes A Number Prime?
To be prime, a number must pass both conditions:
- It must be greater than .
- Its only positive divisors must be and the number itself.
That is why is not prime, and it is also why is prime even though it is even. The number has exactly two positive divisors: and .
How To Tell If A Number Is Prime
For a whole number , you can test whether it is prime by checking whether any whole number from up to divides it exactly.
The reason is practical: if , then one of the factors must be less than or equal to . So if no divisor appears by the time you reach , there is no hidden larger-factor pair waiting above it.
In everyday work, people usually check small divisibility rules first:
- If is even and greater than , it is not prime.
- If the digits add to a multiple of , then is divisible by .
- If ends in or and is greater than , it is divisible by .
Those shortcuts do not prove a number is prime on their own, but they help rule out many composite numbers quickly.
Worked Example: Is Prime?
To test , first note that
So it is enough to check whole-number divisors up to .
- is not divisible by because it is odd.
- is not divisible by because , and is not a multiple of .
- is not divisible by because it does not end in or .
Checking adds nothing here because any multiple of is even, and is already not divisible by .
No divisor up to works, so is prime.
Common Mistakes With Prime Numbers
Saying is prime
It is not. The definition requires exactly two positive divisors, and has only one.
Thinking every odd number is prime
Many odd numbers are composite. For example, is odd, but
so it is not prime.
Checking too far
If you are only testing primality, you do not need to try every number less than . Stopping at is enough.
Where Prime Numbers Are Used
Prime numbers show up in factorization, divisibility, greatest common divisor problems, and least common multiple problems. They matter because every integer greater than can be broken into prime factors in a way that is unique up to order.
They also appear in modular arithmetic and cryptography. In cryptography, the setting is much more specialized, and large primes are used together with additional rules and algorithms.
Try A Similar Problem
Test and with the same square-root method. One is prime and one is composite, so this is a quick way to check whether the stopping rule at makes sense to you.
Need help with a problem?
Upload your question and get a verified, step-by-step solution in seconds.
Open GPAI Solver →