Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!hubcap!ncrcae!ncr-sd!hp-sdd!hplabs!hpda!hpclla!hpcllf!jws From: jws@hpcllf.HP.COM (John Stafford x75743) Newsgroups: comp.lang.pascal Subject: Re: Perfect number program Message-ID: <4450002@hpcllf.HP.COM> Date: Wed, 7-Oct-87 16:14:55 EDT Article-I.D.: hpcllf.4450002 Posted: Wed Oct 7 16:14:55 1987 Date-Received: Sun, 11-Oct-87 08:52:28 EDT References: <9652@brl-adm.ARPA> Organization: Hewlett-Packard CLL Lines: 28 Well it is bound to be slow; perfect numbers are rather scarce. The first four are 6, 28, 496, and 8128. It has been a while since I played with them, but I seem to recall (although I may well be wrong) that: 1. That they have a tendency, for a while, to end alternately with the digits 6 and 28, but not forever. 2. There is a formula involving two raised to prime powers that will generate them for a while, but not forever. I discovered this formula myself only to later discover I was several hundred years too late. For a clue, look at the binary representation of the first four perfect numbers (110, 11100, 111110000, 1111111000000). 3. You might look into Marsienne (spelling?) primes. I believe that each one of them has a related perfect number that is relatively easy to compute (assuming you have an easy way to compute the primes :-{)}). 4. The greeks decided that some numbers are perfect. Numbers whose prime factors add to less than themselves are 'insufficient' and those whose add to more than themselves are 'oversufficient', only a relative few are 'perfect' (or something to that effect). John Stafford -- Hewlett Packard Computer Language Lab {allegra,decvax,ihnp4,ucbvax}!hplabs!hpclla!jws {fortune,sun,thirdi,ucbvax} !hpda !hpclla!jws