comp.lang.ada
 help / color / mirror / Atom feed
From: "isaac2004" <isaac_2004@yahoo.com>
Subject: program that finds amicable pairs and sociable numbers
Date: 13 Feb 2006 10:54:10 -0800
Date: 2006-02-13T10:54:10-08:00	[thread overview]
Message-ID: <1139856850.883467.266980@g44g2000cwa.googlegroups.com> (raw)

hello

i am new to ADA and being a math guy am trying to create a program that
takes 3 inputs from a user, them being a starting integer, a stopping
integer, and an indicated length. the goal of the program is to
determine the sociable pair in the range with the required length.

For example. user inputs following
Start = 12000, Stop = 15000 and Length = 30

program would output
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

notice that the final number in the chain is always equal to the
starting number. this is called a sociable chain. can anybody help me
in creating a program that would do this.

thank you




                 reply	other threads:[~2006-02-13 18:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox