Implemented divisors function and memoize decorator for caching of the
generator functions.