|Bill Allombert on Wed, 07 Mar 2007 20:48:11 +0100|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|Re: newbie question|
> Can you please tell me if there is a builtin function to return a > psuedoprime or prime number of a give number of digits in size? > > I want to get some do some timing tests on various sizes of factoring > of co-primes from about 4 digits each to about 20 digits each. > > The routine that I am looking for would be one that returned a random > prime number of a given size. > > any ideas on this? The simplest is probably to do randomprime(n)=nextprime(random(10^n)) (which actually returns a strong pseudoprime) Cheers, Bill.