A O ( log n ) function returning primefactorization by dividing by smallest prime factor at every step
function getFactorization ( x ) { let ret = [ ] ; while ( x != 1 ) { let temp = spf [ x ] ; ret . push ( temp ) ; while ( x % temp == 0 ) x = Math . floor ( x / temp ) ; } return ret ; }