is prime

MisterX b.xavier at internet.lu
Thu Dec 9 17:44:54 EST 2004


Geoff 

I didn't check the primes rules when I made this function but it works! I
just assumed finding any factors would be quick enough for the small range
of numbers RR can compute natively (2^48 I think was the max). I'll adapt
it!

http://www.utm.edu/research/primes/prove/prove2_1.html
says

<quote>
Home > Primality Proving > Chapter Two > Small Primes

For finding all the small primes, say all those less than 10,000,000,000;
one of the most efficient ways is by using the Sieve of Eratosthenes (ca 240
BC):

"Make a list of all the integers less than or equal to n (greater than one)
and strike out the multiples of all primes less than or equal to the square
root of n, then the numbers that are left are the primes. (See also our
glossary page.)"
<no more quote>

Thanks for bringing that up! 

I think I found an 11 billion digits prime using 
my law of primes! 

I got a pc trying to crunch it since 5 months! ;)
I may need to hack something myself after all to
test it! 

As a quantum geek would say: That's odd!

X


> -----Original Message-----
> From: metacard-bounces at lists.runrev.com 
> [mailto:metacard-bounces at lists.runrev.com] On Behalf Of Geoff Canyon
> Sent: Thursday, December 09, 2004 16:19
> To: Discussions on Metacard
> Subject: Re: is prime
> 
> On Dec 8, 2004, at 10:39 AM, MisterX wrote:
> 
> >  put (x div 2) into xfactors
> 
> I haven't read through the rest carefully, but shouldn't this 
> be trunc(sqrt(x))? You don't need to check for factors beyond 
> the square root.
> 
> regards,
> 
> Geoff Canyon
> gcanyon at inspiredlogic.com
> 
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
> 



More information about the metacard mailing list