A prime number is a whole number greater than with exactly two positive divisors: and itself. So and are prime, is not prime, and a number like is composite. A composite number is any whole number greater than with more than two positive divisors — is composite because it is divisible by and .
For reference, the primes up to are
There is no simple repeating gap pattern: and are close, but the jump from to is larger.
When You Run a Primality Test
You apply the test below whenever you need to decide whether a single whole number is prime — in factorization, divisibility, GCD and LCM work, modular arithmetic, and (with much larger numbers and extra algorithms) cryptography. To be prime, a number must clear two conditions: it must be greater than , and its only positive divisors must be and itself. That is why is not prime, and why is prime even though it is even — it has exactly two divisors, and .
The Steps
For a whole number , test whether any whole number from up to divides it exactly. The reason you can stop at the square root: if , then one factor must be , so if no divisor appears by then, no hidden larger-factor pair waits above it.
In practice, start with quick divisibility rules to eliminate easy cases:
- 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 .
These shortcuts do not prove primality on their own, but they rule out many composites fast.
Full Worked Example: Is Prime?
First find the cutoff:
so it is enough to check whole-number divisors up to .
- is not divisible by — it is odd.
- is not divisible by — , not a multiple of .
- is not divisible by — it does not end in or .
Checking adds nothing, since any multiple of is even and already failed the test. No divisor up to works, so is prime.
Where Students Get Stuck (and How to Check)
- Saying is prime. It is not — the definition needs exactly two positive divisors, and has only one.
- Thinking every odd number is prime. Many odd numbers are composite; for instance . Always run the divisor check, do not assume.
- Checking too far. For primality you do not need every number below — stopping at is enough. If you are testing past the square root, you are wasting effort.
Try It Yourself
Test and with the same square-root method. One is prime and one is composite, which is a quick way to confirm that the stopping rule at truly makes sense to you. Prime numbers matter because every integer greater than factors into primes in a way that is unique up to order — the backbone of much of number theory.
Frequently Asked Questions
- Is 1 a prime number?
- No. A prime number has exactly two positive divisors, 1 and itself. The number 1 has only one positive divisor.
- Is 2 the only even prime number?
- Yes. Every even number greater than 2 is divisible by 2, so it is not prime.
Need help with a problem?
Upload your question and get a verified, step-by-step solution in seconds.
Open GPAI Solver →