obspy.core.util.misc.factorize_int

factorize_int(x)[source]

Calculate prime factorization of integer.

Could be done faster but faster algorithm have much more lines of code and this is fast enough for our purposes.

http://stackoverflow.com/questions/14550794/ python-integer-factorization-into-primes

>>> factorize_int(1800004)
[2, 2, 450001]
>>> factorize_int(1800003)
[3, 19, 23, 1373]