Prime Number Checker
Prime Number Checker
Check whether a whole number is prime or composite. Enter a number below to get an instant result.
Check a Number
What is a Prime Number?
A prime number is a whole number greater than 1 that has exactly two positive factors: 1 and the number itself.
For example, 7 is prime because its only positive factors are 1 and 7.
2, 3, 5, 7, 11, 13, 17, 19, 23 and 29.
What is a Composite Number?
A composite number is a whole number greater than 1 that has more than two positive factors.
12 has the factors 1, 2, 3, 4, 6 and 12. Because it has more than two factors, 12 is composite.
Is 1 a Prime Number?
No. The number 1 is neither prime nor composite. A prime number must have exactly two positive factors, while 1 has only one positive factor: itself.
Is 2 a Prime Number?
Yes. 2 is the only even prime number. Its only positive factors are 1 and 2.
Prime Numbers from 1 to 100
How Does the Prime Number Checker Work?
The calculator checks whether the entered number can be divided evenly by another whole number between 2 and its square root.
If a divisor is found, the number is composite. If no divisor is found, the number is prime.
The square root of 29 is approximately 5.39.
We only need to test possible divisors up to 5.
29 is not divisible by 2, 3 or 5.
Therefore, 29 is a prime number.
Prime Number Examples
| Number | Result | Reason |
|---|---|---|
| 2 | Prime | Exactly two factors: 1 and 2 |
| 7 | Prime | Exactly two factors: 1 and 7 |
| 12 | Composite | Has more than two factors |
| 17 | Prime | Exactly two factors: 1 and 17 |
| 25 | Composite | Divisible by 5 |
Frequently Asked Questions
What is the smallest prime number?
The smallest prime number is 2.
Is 0 a prime number?
No. Zero is neither prime nor composite because it does not have exactly two positive factors.
Is 1 a prime number?
No. The number 1 has only one positive factor, so it is neither prime nor composite.
Is every odd number prime?
No. Although every prime number greater than 2 is odd, many odd numbers are composite. For example, 9, 15 and 21 are odd composite numbers.
Can I check a negative number?
Prime and composite classification is normally applied to positive whole numbers greater than 1. The calculator therefore explains that negative numbers are not classified as prime or composite.
Can I check decimal numbers?
This calculator is designed for whole numbers. Decimal values are rejected because prime-number classification is defined for positive whole numbers.
Comments
Post a Comment