A proper divisor of a positive integer n is a positive integer less than n that evenly divides n. So, for instance, the proper divisors of 30 are 1, 2, 3, 5, 6, 10, and 15.
A positive integer is said to be perfect if it is equal to the sum of its proper divisors. So 30 is not perfect -- the sum of its proper divisors is 42, not 30. But 28 is perfect, since its proper divisors (1, 2, 4, 7, and 14) add up to 28.
Two positive integers m and n are said to be amicable if the sum of m's proper divisors is n and the sum of n's proper divisors is m.
The exercise is in four parts:
Design, write, and test a Scheme procedure that takes any positive integer as its argument and returns a list of that integer's proper divisors.
Using the procedure defined in the previous part, design, write, and test a Scheme procedure that takes any positive integer as its argument and returns the sum of that integer's proper divisors.
Using the procedures defined in the previous parts, design, write, and test a Scheme procedure that takes any positive integer k as its argument and returns a list of all the perfect numbers less than or equal to k.
Using any procedures that you like, design, write, and test a Scheme procedure that takes any positive integer k as argument and returns a pair of amicable numbers, both of them greater than or equal to k, as a two-element list.
This exercise will be due at 2:15 p.m. on Wednesday, February 16.