Let d(n) be the sum of proper divisors of n (numbers less than n that divide into n evenly). If d(a) = b and d(b) = a, where a != b, then a and b are an amicable pair. For example, d(220) = 284 and d(284) = 220, so 220 and 284 are amicable. Given n, evaluate the sum of all amicable numbers below n.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 10^5
Tags:
