Prime Numbers are those numbers which have exactly two factors . (Basic).One of those factor is 1 and other is the number itself.
For example, 37=37*1 and no any other factors are there. So, 37 is Prime Number.
But most people get confused that 1 is prime or not because 1 is it's factor and the number itself is also a factor that is 1. But there is no two factors of 1 so it is not satisfying condition that prime number has exactly two factors . So,1 is not a prime number.
Now, You know what prime number is??
How to find prime Numbers?
- First way to find prime numbers is to divide by all numbers less than the given number if it gets divided then that is not prime and if not then that is Prime.
Let to know 5 is Prime or not ;then divide 5 by 2,3,4 (as 1 divides every number) .
5%2=1 [% gives remainder ] 5%3=2 ,5%4=1
Now no one gave output zero means that 5 is not divided. So,5 is prime.
Let’s check it for 10---->>>>>
10%2=0 >>>> No need to check further it’s not going to be prime .
- Second way to check prime number is to Take the square root of number (Only whole part) and then check whether the given number is being divided from 2 to square-root of the number . If any number wouldn’t divide the given number then it is prime.
For exmaple — To check 37 is prime or not (We know that): : Let’s take square-root of 37= 6.something
Now check from 2 to 6; if any number divides 37 then it is not prime otherwise it’s prime.
- Now Third way to get prime numbers is Seive Eratosthenes Algorithm Let to find prime numbers up to 50 then write all numbers from 2 to 50(as 1 is not prime).
Now take 2 out and remove all those which are divisible by 2. (Store all Out values).
You can take out those numbers only which are left.
Now take 3 out and remove all those which are divisble by 3.
Now take 5 out and remove all those which are divisble by 5.
Continue this up to the number which is left. And finally you will get prime Numbers only>>>>
That’s all about Prime Numbers.
0 comments:
Post a Comment