A O ( log n ) function returning primefactorization by dividing by smallest prime factor at every step
static ArrayList getFactorization ( int x ) { ArrayList ret = new ArrayList ( ) ; while ( x != 1 ) { ret . Add ( spf [ x ] ) ; x = x / spf [ x ] ; } return ret ; }