Test of Prime Number
To check whether number N is a prime, it involves following steps.
Step 1: Take the square root of the given number N.
Step 2: Round the square root to the immediately lower integer. Call it z.
Step 3: Check for divisibility of the number N by all prime numbers below z. If there is no prime number below the value of z which divides N then number N will be prime.
Illustration:-
Checking 239 is a prime or not.
Step 1: taking square root of 239, $$\sqrt {239} $$ lies between 15 and 16.
Step 2: taking value of z = 16.
Step 3: Prime numbers less than 16 are 2, 3, 5, 7, 11 and 13. And 239 are not divisible by any of these then 239 is prime number.
Join The Discussion