“So sometimes it gives confusion on checking if the given number is a prime number or not, Simply prime numbers have no divisors. Examples are 2, 3, 5, 7, 13. 4,9 or 12 are not primes because these numbers can be divided by 2 and 3 or by 2,3,4 and 6. This simple idea has been drawn into a complex theory of how a series of primes will look or methods to generate the primes..”
How To Check If Number Is Prime
To check whether a number is a prime or not what we need to do is try to divide the number by the numbers, only the primes that is, that go before. The first is to divide by 2. All even numbers are divisible. This eliminates all even numbers from ‘primeship’. Next by 3,5,7 and so on. We can check out like this for any number up to, say, 1,000, in a few minutes.
With large numbers, the exercise could get devilishly difficult. Fortunately, computers can get by with fairly large numbers, even 20 or 30 digits long. But with really large numbers, even computers would take years, even centuries!
The idea has proved useful in creating codes to convert secret messages, like we have in banking transactions, into ciphers. Cracking a code based on large numbers, even with the help of computers becomes nearly impossible.
Related posts:


