Oct-01-2017, 04:21 PM
(This post was last modified: Oct-01-2017, 04:22 PM by gruntfutuk.)
Ok, so you need to:
a) come up with an algorithm to determine if a value is a prime number
.. there's an obvious way to do this (divide by all lower numbers starting from 2 to find no remainder)
.. and a more efficient mathematical approach, which you can easily look up
b) come up with an algorithm to choose the next highest integer incrementally, testing each one to see if it is prime
How far have you got?
a) come up with an algorithm to determine if a value is a prime number
.. there's an obvious way to do this (divide by all lower numbers starting from 2 to find no remainder)
.. and a more efficient mathematical approach, which you can easily look up
b) come up with an algorithm to choose the next highest integer incrementally, testing each one to see if it is prime
How far have you got?
I am trying to help you, really, even if it doesn't always seem that way