From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7255bf4b86d6b125,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail From: "isaac2004" Newsgroups: comp.lang.ada Subject: help with starting a program (newbie) Date: 16 Feb 2006 13:47:44 -0800 Organization: http://groups.google.com Message-ID: <1140126464.020101.55150@o13g2000cwo.googlegroups.com> NNTP-Posting-Host: 140.160.136.68 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1140126469 24874 127.0.0.1 (16 Feb 2006 21:47:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 16 Feb 2006 21:47:49 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: o13g2000cwo.googlegroups.com; posting-host=140.160.136.68; posting-account=bWy1LAwAAAAtVkasDCH0ykMCBMNd-FcL Xref: g2news1.google.com comp.lang.ada:2920 Date: 2006-02-16T13:47:44-08:00 List-Id: hello i am in a basic ada class and i have an assignment that asks to find all sociable chains in a range defined by the user. A sociable chain is a generalization of the notion of amicable pairs. More precisely, a sociable chain is sequence of positive integers, like I(1), I(2), .. I(N) in which (1) each element I (i) is equal to the sum of the proper divisors of I(i-1) , (2) I (N) = I (1) and (3) none of the integers between the I (1) and I (N) are equal (if there are any integers between the first and the last; for chains of length two, i.e., perfect numbers, of course there won't be). this is the thoery behind sociable chains. the program will ask for 3 inputs from a user, them being a start of the number range, an end of the numebr range, and finally a maximum chain length. Sample Run of Program ----------------------------------- Start = 12000 Stop = 15000 Length = 30 after input program computes all possible chains in the range of numbers with a maximum chain length of 30 numbers example This chain is 3 in length. 12285 14595 12285 This chain is 6 in length. 12496 14288 15472 14536 14264 12496 This chain is 6 in length. 14264 12496 14288 15472 14536 14264 This chain is 6 in length. 14288 15472 14536 14264 12496 14288 This chain is 29 in length. 14316 19116 31704 47616 83328 177792 295488 629072 589786 294896 358336 418904 366556 274924 275444 243760 376736 381028 285778 152990 122410 97946 48976 45946 22976 22744 19916 17716 14316 This chain is 6 in length. 14536 14264 12496 14288 15472 14536 This chain is 3 in length. 14595 12285 14595 ------------------------------------------------\ the program uses the idea from this function function Sum_Of_Divisors ( N : Natural ) return Natural is Sum : Natural; begin Sum := 0; for I in 1 .. N - 1 loop if N rem I = 0 then Sum := Sum + I; end if; end loop; return Sum; end Sum_Of_Divisors; this program finds the sum of the divisors of any number entered. any help with this program would be greatly appreciated. thank you isaac