refactored divisor digits problem