Counting pairs of amicable numbers

I want to have a count for amicable numbers. For example, 220 and 284 is count = 1, 1184 and 1210 is count = 2, 2620 and 2924 is count = 3 and so on... So for this case, there are three pairs of amicable numbers, so when I output count, it should be 3. Anyone know how to display the count?

Here is a sample run:

Input the start of the range: 1
Input the end of the range: 1300
220 and 284 are amicable numbers
1184 and 1210 are amicable numbers
Range of numbers: 1 - 1300
Pairs of amicable numbers = 2

Topic archived. No new replies allowed.