Prime Number Checker
NUMBER THEORY TOOL
Prime Number Checker
Check whether a number is prime and discover prime numbers in any valid range.
Prime Number Checker
Test one whole number
Prime Number Finder
Find primes within a range
What Is a Prime Number?
A prime number is a whole number greater than 1 that has exactly two positive factors: 1 and itself. For example, 2, 3, 5, 7, 11 and 13 are prime numbers.
A number greater than 1 that has more than two positive factors is called a composite number. For example, 12 is composite because it can be divided evenly by 1, 2, 3, 4, 6 and 12. The numbers 0 and 1 are neither prime nor composite.
Every other even whole number greater than 2 is composite.
One has only one positive factor, not exactly two.
To test a number, it is enough to check divisors up to its square root.
Prime Number Formula and Method
There is no simple formula that directly lists every prime number. A standard way to test an integer \(n\) is to check whether any integer divisor exists between 2 and \(\sqrt{n}\).
For \(n > 1\): if no integer \(d\) from \(2\) through \(\lfloor\sqrt{n}\rfloor\) divides \(n\) evenly, then \(n\) is prime.
If any such divisor exists, the number is composite.
Worked example: Is 29 a prime number?
- Calculate the square root: \(\sqrt{29} \approx 5.39\).
- Test the prime divisors up to 5: 2, 3 and 5.
- 29 is not divisible evenly by 2, 3 or 5.
- Therefore, 29 is a prime number.
Worked example: Is 21 a prime number?
- Calculate the square root: \(\sqrt{21} \approx 4.58\).
- Check 2, 3 and 4.
- 21 is divisible by 3 because \(21 \div 3 = 7\).
- Therefore, 21 is a composite number.
Prime Numbers from 1 to 100
Use this table as a quick reference when studying prime numbers. The number 1 is included for comparison but is not prime.
| Range | Prime numbers |
|---|---|
| 1–10 | 2, 3, 5, 7 |
| 11–20 | 11, 13, 17, 19 |
| 21–30 | 23, 29 |
| 31–40 | 31, 37 |
| 41–50 | 41, 43, 47 |
| 51–60 | 53, 59 |
| 61–70 | 61, 67 |
| 71–80 | 71, 73, 79 |
| 81–90 | 83, 89 |
| 91–100 | 97 |
Practical Applications of Prime Numbers
- Mathematics education: learning factors, divisibility and number patterns.
- Computer science: prime numbers are used in some hashing methods and algorithm design.
- Cryptography: large prime numbers play an important role in public-key systems such as RSA.
- Problem solving: identifying prime factors can help simplify fractions and solve number theory problems.
Frequently Asked Questions
Is 1 a prime number?
No. A prime number must have exactly two distinct positive factors. The number 1 has only one positive factor.
Is 2 a prime number?
Yes. The number 2 has exactly two positive factors, 1 and 2. It is also the only even prime number.
How can I check whether a number is prime?
For an integer greater than 1, check whether any integer from 2 up to its square root divides it evenly. If none does, the number is prime.
What is the difference between prime and composite numbers?
A prime number greater than 1 has exactly two positive factors. A composite number has more than two positive factors. Zero and one are neither prime nor composite.
Can this tool find prime numbers in a range?
Yes. Enter a start and end number in the Prime Number Finder. The tool lists the prime numbers within the inclusive range, subject to its range-size limit.
Are negative numbers prime?
Under the standard definition used here, prime numbers are positive integers greater than 1. Negative integers are not classified as prime by this calculator.
