Problem 12: Updating method to calculate divisors