improve #21 solution with optimized sumOfDivisors helper function