Find Amicable numbers using Python
Amicable numbers are two different numbers related in such a way that the sum of the proper divisors of each is equal to the other number. The smallest pair of amicable numbers is ( 220 , 284 ). They are amicable because the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110, of which the sum is 284; and the proper divisors of 284 are 1, 2, 4, 71 and 142, of which the sum is 220. (A proper divisor of a number is a positive factor of that number other than the number itself. For example, the proper divisors of 6 are 1, 2, and 3.) Below Python code can be used to identify Amicable numbers from a list. def sumofdivident (num): sum = 0 for i in range ( 1 , num): if num % i == 0 : sum += i return sum def isamicable (num1 , num2): return sumofdivident(num1) == num2 and sumofdivident(num2) == num1 def findpairs (mylist): pairs = [] for i in range ( len (mylist)): f...