Pre - computation of smallest prime divisor of all numbers
void sieveOfEratosthenes ( ) { for ( int i = 2 ; i * i < MAX ; ++ i ) { if ( ! primedivisor [ i ] ) for ( int j = i * i ; j < MAX ; j += i ) primedivisor [ j ] = i ; }