Best Algorithm to find Prime numbers. Best Algorithm to find Prime numbers. @Mathematics
You're asking a question which has no definitive answer. The only one I'm familiar with is the Sieve of Eratosthenes, but even that one will only get you up to the millions. Anything larger and it gets increasingly difficult.
In Italy we call it Crivello di Eratostene, it tells you if a number is a prime number or not, it's very easy to understand: You try to divide the number for every integer before it (besides the number you are checking and 1), if any division has a integer as result, your number is not prime.
I have tried the Sieve of Eratosthenes, but i want more fast algorithm.
Have you tried the Sieve of Atkin? It's a modified Eratosthenes' one and should work faster.
nop, i will try it. Thanks.
Join our real-time social learning platform and learn together with your friends!