A faster implementation for arithmetic functions

In the previous versions, when I got a number about one billion, it's too slow to calculate its Euler's totient function or its factors sum function.
This implementation works in O(sqrt(the maximum prime factor)).