ExamVeda
Login
Home

How to Test a number is Prime Number or not

Administrator Oct 13, 2015 Number System 0 comments
Share this article

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.

Click Here for Solved Examples on Number System

Share with your Friends

Help others discover this useful content.

Join The Discussion

Have something to add? Share your thoughts.

Comments 0

Discussion from ExamVeda readers.
Be the first one to review. Share your thoughts about this topic.