Fix divisors algorithm in Problem #3