What is a Prime Number?
Prime number is a positive number that has only two divisors “1” & “itself”. Simply say, a prime number is not divisible by any other “even or odd” number other than itself such as {2, 3, 5, 7, 11, …}.
In a general way, prime numbers are always greater than “1” and have only two factors (1 & itself). If any number has factors rather than (1 & itself) then it is a composite number such as {4, 6, 8, 9, 10, …}.
How to Check a Number is Prime?
To quickly check whether the number is prime or not then use our above prime number checker. However, if you want to check manually, then use the below methods:
- Prime Factorization Method
- Trial Division Method
- Sieve of Eratosthenes
- AKS Primality test
Before checking of given number, you should remember some basic rules:
- If the number is less than “2” then it is not prime.
- If the number is even & greater than “2” then not a prime number.
- If the given number is exactly “2” then it is prime (2 is only even that is a prime number).
Example:
See the below examples for a better understanding of the identification of prime or composite numbers:
Is “2” a prime number?
Yes, The factors of two are “1 & 2 then 2 is a prime number.
Is 17 a prime number?
Yes, It is a prime b/c “17” has only two factors “1 and 17”.
Is 29 a prime or composite?
“29” is a prime number b/c factors of 29 are “1 & 29”.
Is 51 a prime number?
No, 51 is not a prime number. But “51” is a composite number b/c its factors are rather than “1 & itself” such as: 1, 3, 17, 51.