The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » sci.math.* » sci.math

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to test a pseudo random prime number generator?
Replies: 17   Last Post: Sep 4, 2007 5:47 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Ben Rudiak-Gould

Posts: 210
Registered: 2/2/05
Re: How to test a pseudo random prime number generator?
Posted: Aug 19, 2007 6:05 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

quasi wrote:
> rossum <> wrote:
>> repeat
>> n <- random(lo, hi)
>> until IsPrime(n)

> Yes, but it's not uniformly random on the set of primes in the range
> lo .. hi. See my recent replies.

Yes it is. There's no reason for it to prefer any prime in the range over
any other. It doesn't use nextprime().

-- Ben

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.