Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!brianc From: brianc@cognos.uucp (Brian Campbell) Newsgroups: comp.lang.pascal Subject: Re: Perfect number program Message-ID: <1557@cognos.UUCP> Date: Mon, 12-Oct-87 22:36:13 EDT Article-I.D.: cognos.1557 Posted: Mon Oct 12 22:36:13 1987 Date-Received: Thu, 15-Oct-87 06:48:16 EDT References: <9652@brl-adm.ARPA> Reply-To: brianc@cognos.UUCP (Brian Campbell) Organization: Cognos Incorporated, Ottawa, Canada Lines: 23 In article <9652@brl-adm.ARPA> 11SSTEIN%GALLUA.BITNET@wiscvm.wisc.EDU writes: ! ! I am working on a perfect number program and I have faced some problems. ! ! Notice: A perfect number is a number that has its divisors add up to itself. ! I.E. 6 = 1 + 2 + 3 = 6 ! 28 = 1 + 2 + 4 + 7 + 14 = 28 ! ! All that... you have an idea on a good program? I'm not sure whether your program is supposed to generate ALL perfect numbers or not. Nor am I sure the following produces all of the perfect numbers. Anyway, I remember some math text that listed the theory (?) that if: (2 ^ n) - 1 is prime, then [(2 ^ n) - 1] * (2 ^ [n - 1]) is perfect Hope this helps... -- Brian Campbell uucp: decvax!utzoo!dciem!nrcaer!cognos!brianc Cognos Incorporated mail: POB 9707, 3755 Riverside Drive, Ottawa, K1G 3Z4 (613) 738-1440 fido: sysop@163/8