Prime Factorization stuff for python