[algogeeks] Re: Best Algorithm to find a Prime Number

2006-04-30 Thread Daniel Etzold
Hi, the GMP has an implementation of the Rabin-Miller test and supports very large numbers. http://www.swox.com/gmp/ http://www.swox.com/gmp/manual/Number-Theoretic-Functions.html#Number%20Theoretic%20Functions Regards, Daniel Nat (Padmanabhan Natarajan) wrote: > Hi, > > Mayur, even though pr

[algogeeks] Re: Best Algorithm to find a Prime Number

2006-04-29 Thread Nat (Padmanabhan Natarajan)
Hi,Mayur, even though primality testing has been proven to be polynomial in time, the randomized ones are what are being used due to efficiency considerations.Arul, you may be better off searching for Rabin-Miller test. Wikipedia also has an interesting article with further links. Cheers,NatOn 4/29

[algogeeks] Re: Best Algorithm to find a Prime Number

2006-04-29 Thread Mayur
Hi, If you are looking for primality testing, google for the paper "Prime is in P". The original paper's by three IIT-Kanpur people. The papers that followed up give the best algorithms for checking primality. If you are looking for prime number generation, look out for "sieve methods" - especiia

[algogeeks] Re: Best Algorithm to find a Prime Number

2006-04-29 Thread B. P. TBC
This algorithm (in Pascal) returns True, if x is a prime number, and returns False, if x isn't prime. function Prime(x: word): boolean; var i: word; v: boolean; Begin v := False; if x=1 then v := True; for i:=2 to round(sqrt(x)) do Begin if x mod i = 0 then v := True

[algogeeks] Re: Best Algorithm to find a Prime Number

2006-04-29 Thread Mohammad Moghimi
Hi, give more specification of the problem.I think --return aPrimeNumberSuchAs2;--is good solution for your problem!!!On 4/29/06, Arulanandan P <[EMAIL PROTECTED]> wrote: Hi ,     can anybody tell me best algorithm for finding a Prime Numberbyearulanandan --