Computer Science, asked by gaggi6796, 3 months ago

WAP to input two integers and find if they are amicable number or not.
Amicable numbers are those when the sum of factors of one number is equal to the other number. Ex. 220 and 284 . Factors of 220 are - 1,2,4,5,10,11,20,22,44,55 and 110 when added gives 284 . Similarly , factors of 284 are 1,2,4,71 and 142 when added gives 220 .

Answers

Answered by atulkumargpt
0

Answer:

#python ....

a = int(input("1st num : "))

b = int(input(" 2nd num : "))

r = []

def factors(x):

for i in range(1, x + 1):

if x % i == 0:

r.append(i)

factor(b)

s = 0

for c in r: s += int(c)

print(" numbers are ")

if s == b:print("Amicable ")

else:print(" not Amicable ")

Similar questions