Let a be given number and n be the smallest counting number , where
Now if, a is divisible by any prime number less than or equals to n, it is not a prime else it is a prime
Ex- Check if 437 is a prime number?
Prime numbers less than 21: 2, 3,5,7,11,13,17,19
Here 437 is divisible by 19, Hence 437 is not a prime number.