java Programming Glossary: eratosthenes
Most elegant way to generate prime numbers http://stackoverflow.com/questions/1042902/most-elegant-way-to-generate-prime-numbers and Rekreativc A very clean implementation of the sieve of Eratosthenes starblue Use Java's BigInteger s and nextProbablePrime for very..
Arcane isPrime method in Java http://stackoverflow.com/questions/12715679/arcane-isprime-method-in-java below As @TeddHopp notes the well known sieve of Eratosthenes approach would not bother to check multiples of integers such..
Checking if an int is prime more efficiently http://stackoverflow.com/questions/2777509/checking-if-an-int-is-prime-more-efficiently up to 2 000 000 000 using something like the Sieve of Eratosthenes . You can store whether each number is prime in a bit array...
Finding prime numbers with the Sieve of Eratosthenes (Originally: Is there a better way to prepare this array?) http://stackoverflow.com/questions/586284/finding-prime-numbers-with-the-sieve-of-eratosthenes-originally-is-there-a-bet prime numbers with the Sieve of Eratosthenes Originally Is there a better way to prepare this array Note.. prepare this array Note Version 2 below uses the Sieve of Eratosthenes. There are several answers that helped with what I originally.. with what I originally asked. I have chosen the Sieve of Eratosthenes method implemented it and changed the question title and tags..
Calculating and printing the nth prime number http://stackoverflow.com/questions/9625663/calculating-and-printing-the-nth-prime-number Eliminating composites by prime divisors the Sieve of Eratosthenes Instead of investigating the numbers in sequence and checking.. of a given prime in one go. This is known as the Sieve of Eratosthenes To find the prime numbers not exceeding N make a list of all.. Atkin has lower algorithmic complexity than the Sieve of Eratosthenes and hence is preferable for large limits for small limits a..
|