Practice
Senior Example Problem 1: Amicable Numbers
Amicable Numbers
- The numbers 220 and 284 are called Amicable Numbers because, for each, the sum of its divisors equals the other number. That is, the sum of the divisors of 220, 1 + 2 + 4 + 5 + 10 + 11 + 20 + 22 + 44 + 55 + 110 equals 284,and the sum of the divisors of 284, 1 + 2 + 4 + 71 + 142 equals 220.
Instructions
- Write a program that prints all pairs of Amicable Numbers between 1 and 10 000.
- Your output should contain each pair of Amicable Numbers, on a line per pair, separated by a space.
- Output sould be ordered so that the first of each pair is in ascending; so the pair 220 284 will come on a line before 284 220.
- No other output should be produced by your program other than the numbers.