comp.lang.ada
 help / color / mirror / Atom feed
* program that finds amicable pairs and sociable numbers
@ 2006-02-13 18:54 isaac2004
  0 siblings, 0 replies; only message in thread
From: isaac2004 @ 2006-02-13 18:54 UTC (permalink / 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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-13 18:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-13 18:54 program that finds amicable pairs and sociable numbers isaac2004

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