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

Sheila King sheila@thinkspot.net
Sun, 08 Apr 2001 23:57:40 -0700


On Mon, 09 Apr 2001 08:50:51 +0200, Gregor Lingl <glingl@aon.at>  wrote about
Re: [Tutor] Primes on a two-dimensional plane in the form of a  rectangular
spiral:

:P.S.: Interesting would be a (more or less) simple and efficient way to
:calculate from a given prime p next_prime(p). Perhaps someone else
:knows one ....

I believe that the algorithm that is generally considered the quickest for
calculating primes, is called the "Sieve of Erasthones". (sp?)

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...

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/