|
|||||||||||||||||
![]() |
![]() |
![]() |
|||||||||||||||
|
Is-Prime Algorithm
Based on Sieve of Erastosthenes in the previous section, we can devise an algorithm to find out prime number. The algorithm below determines whether a positive integer number N larger or equal to 2 is a prime number or not:
The flow chart of the Is Prime algorithm above is shown as follow
Example of application: in cryptography, large prime number is used to send secret message. In the next section, you will learn something fundamental in arithmetic that is very useful for many practical applications. Preferable reference for this tutorial is Teknomo, Kardi (2010) Prime factor tutorial. http:\\people.revoledu.com\kardi\ tutorial\BasicMath\Prime\ |
|||||||||||||
|
||||||||||||||
|
||||||||||||||