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