Dynata data-quality checks may need to classify mathematical relationships between numeric values. Given two positive integers, determine whether they form an amicable pair.
Two distinct numbers a and b are amicable when the sum of the proper divisors of a equals b, and the sum of the proper divisors of b equals a. A proper divisor is a positive divisor smaller than the number itself.
Your solution must avoid scanning every integer from 1 through n. Use divisor-pair reasoning so that each number can be processed in O(sqrt(n)) time.
Implement amicable_pair(a, b).
a and b.True if they form an amicable pair, otherwise return False.def amicable_pair(a, b):