[Tutor] Primes on a two-dimensional plane in the form of a rectangular spiral

Moshe Zadka moshez@zadka.site.co.il
Tue, 10 Apr 2001 14:08:01 +0300


On Sun, 08 Apr 2001, Sheila King <sheila@thinkspot.net> wrote:

> However, this algorithm requires that you start from the number "two" and work
> your way on up. I don't believe there is any way to start at an arbitrary
> prime number and find the next prime without knowing the preceding primes. So,
> you'd have to implement the Sieve of Erasthones in any case, even though you
> were only interested in finding a single number.
> 
> I'm always willing to find out I'm wrong, if someone else knows better...

Dead wrong!
The quicket algorithm would be to use Rabin's Criterion for primality,
starting at p, and moving up.
It is guranteed to stop before 2*p.
-- 
"I'll be ex-DPL soon anyway so I'm        |LUKE: Is Perl better than Python?
looking for someplace else to grab power."|YODA: No...no... no. Quicker,
   -- Wichert Akkerman (on debian-private)|      easier, more seductive.
For public key, finger moshez@debian.org  |http://www.{python,debian,gnu}.org