#---------------------------- finding factors of a number --------------------------------
num = int(input("Enter a number : "))
print("The factors are : ")
for i in range(1,num+1):
if(num%i == 0):
print(i,end =' ')
#---------------------------- finding a number is a perfect number --------------------------
# A number is said to be perfect number if 'sum of its factor is equal' to the given number
num = int(input("Enter a per number : "))
sum =0
for i in range(1,num):
if(num%i == 0):
sum+=i
if(sum == num):
print(num,"is a perfect number.")
#---------------------------- finding a number is a abundant number ------------------------
# A number is said to be perfect number if 'sum of its factor is greater' than given number
num = int(input("Enter a ab number : "))
sum =0
for i in range(1,num):
if(num%i == 0):
sum+=i
if(sum > num):
print(num,"is a abundant number.")
#---------------------------- finding a number is a deficient number ------------------------
# A number is said to be deficient number if 'sum of its factor is lesser' than given number
num = int(input("Enter a def number : "))
sum =0
for i in range(1,num):
if(num%i == 0):
sum+=i
if(sum < num):
print(num,"is a Deficient number.")
#---------------------------- finding a number is a amicable pair ----------------------------
# A pair number is said to be Amicable pair if 'sum of factor of num1' == num2 and 'sum of factor of num2' == num1
num1 = int(input("Enter 1st number : "))
num2 = int(input("Enter 2nd number : "))
sum1 =0
sum2 =0
for i in range(1,num1):
if(num1%i == 0):
sum1+=i
for j in range(1,num2):
if(num2%j == 0):
sum2+=j
if(sum1 == num2 and sum2 == num1):
print(num1,",",num2,"is a Amicable Pair")
else:
print(num1,",",num2,"is not a Amicable Pair")