simplifying exponent calculation with generic memoizers