Page 1 of 1

Primes

Posted: Tue Jan 25, 2005 7:19 pm
by Marcin Kwiatkowski
Could anybody tell me if there's a method which checks if the number n is a prime? I know only an algo O(sqrt(n)) which is well-know. There's Eratostenes' Sieve too, but the big numbers cannot be checked due to memory limits.

Posted: Tue Jan 25, 2005 7:26 pm
by ..

Posted: Fri Jan 28, 2005 1:29 am
by Larry
You can also check out the BigInteger source code in Java's API. They have various implementation in there.