From: Kollege Boy
Subject: Perfect numbers
Date: 
Message-ID: <1109819774.405607.126990@o13g2000cwo.googlegroups.com>
Is there any snippets out there that find perfect numbers???

With using DO

I'm looking at Mercannes's  "theory" or "algorithm" ???
and I'd just like to see how others handle the prime number function
before they try to find a perfect number.
Thanks

From: Gareth McCaughan
Subject: Re: Perfect numbers
Date: 
Message-ID: <87ll92kl7d.fsf@g.mccaughan.ntlworld.com>
Kollege Boy wrote:

> Is there any snippets out there that find perfect numbers???
> 
> With using DO
> 
> I'm looking at Mercannes's  "theory" or "algorithm" ???
> and I'd just like to see how others handle the prime number function
> before they try to find a perfect number.

No one's ever found an odd perfect number, and maybe
there aren't any.

All even perfect numbers come from Mersenne primes,
which is to say primes of the form 2^p-1. There are
specially efficient ways of testing numbers of this
form for primality; there's an algorithm attributed
to Lucas that does it using a Fibonacci-like recurrence,
for instance. There are probably faster ways, now.
In any case, you wouldn't use a general-purpose
primality testing algorithm.

The GIMPS project can doubtless provide you with
lots of code in C or C++ or some such horror, but
the chances are that their choices of algorithm
will be good. For all this stuff, Google is your friend.

I'm not sure what you mean by "With using DO";
why do you care what looping construct you use?

-- 
Gareth McCaughan
.sig under construc
From: John Thingstad
Subject: Re: Perfect numbers
Date: 
Message-ID: <opsm6iwxiypqzri1@mjolner.upc.no>
On 2 Mar 2005 19:16:14 -0800, Kollege Boy <···········@mnsu.edu> wrote:

> Is there any snippets out there that find perfect numbers???
>
> With using DO
>
> I'm looking at Mercannes's  "theory" or "algorithm" ???
> and I'd just like to see how others handle the prime number function
> before they try to find a perfect number.
> Thanks
>

You might try posting this to sci math.
I (and another student) wrote a essay on perfect numbers some years back  
and
the information from sci.math was invaluable.

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/