Use prime factorization

Algorithm taken from http://www.mathblog.dk/uva-294-divisors/