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