 The common divisors can be found by dividing both numbers by successive integers from 2 to the smaller number "b".The number of steps of this approach grows linearly with "b", or exponentially in the number of digits.Another inefficient approach is to find the prime factors of one or both numbers.