N is now N / s [ N ] . If new N als has smallest prime factor as currFactor , increment power
if ( currFactor == s [ N ] ) { power ++ ; continue ; } int sum = 0 ; for ( int i = 0 ; i <= power ; i ++ ) sum += pow ( currFactor , i ) ; ans *= sum ;