Amicable Numbers

amicableAmicable Numbers Definition

Two positive integer numbers (m, n) are amicable if the sum of the proper divisors of (m) is equal to (n) and the sum of the proper divisors of (n) is equal to (m). A proper divisor of a number does not include the number itself. For example, the proper divisors of (4) are 1 and 2 only.

Amicable Numbers Examples

Amicable Numbers C++

Amicable Numbers Under 10000

If you want to print amicable numbers list under 10000 then you need to have two nested loops. The first loop goes from i = 1 to 10000 and the second loop goes from j = i + 1 to 1000. There is no need to go from 1 to 10000 in each loop otherwise there is going to be a lot of repetitions. Note also that these two nested loops are going to take a long time to run for larger numbers of (n) and (m).

Amicable Numbers Program in Java

Tags:,

Add a Comment

Your email address will not be published. Required fields are marked *