Hey guys. So I am trying to just get a method that can tell me if a BigInteger is FOR SURE prime, and I have had little luck. The best method that I have found online says 25 is prime... anyone know a good way to do it?
Printable View
Hey guys. So I am trying to just get a method that can tell me if a BigInteger is FOR SURE prime, and I have had little luck. The best method that I have found online says 25 is prime... anyone know a good way to do it?
You see, the computation of primes always was pretty difficult problem. You have to do lot's of computations to discover whether a number is a prime or not. The most straightforward algorithm is to check whether a number can be divided by some number less than it. And it appears to be pretty efficient, but not in the context of prime number generator.
For large numbers, you would have to look deeper and study things like the Sieves of Eratosthenes, Euler etc ... (Sieve of Eratosthenes - Wikipedia, the free encyclopedia)