Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!rutgers!mcnc!ece-csc!ncrcae!hubcap!grimlok From: grimlok@hubcap.UUCP (Mike Percy) Newsgroups: comp.lang.pascal Subject: Re: Perfect number program Message-ID: <552@hubcap.UUCP> Date: Thu, 8-Oct-87 00:40:12 EDT Article-I.D.: hubcap.552 Posted: Thu Oct 8 00:40:12 1987 Date-Received: Sun, 11-Oct-87 00:51:50 EDT References: <9662@brl-adm.ARPA> Organization: Clemson University, Clemson, SC Lines: 17 in article <9662@brl-adm.ARPA>, silva@tcgould.TN.CORNELL.EDU (Victor M. Silva) says: > > You can reduce your processing time in half by just having your inner > loop (FOR K=2 TO I...) only go to I/2 since anything larger cannot be > a divisor (ie. 2*(I+1) > I ). > Actually, you only have to go to sqrt(i), since anything above sqrt(i) will have already been discovered as "the other factor" in a factor pair. I seem to remember doing this a while back...where did I put that cocktail napkin...