Compute all primes smaller than or equal to square root of n using simple sieve
int limit = ( int ) ( Math . Floor ( Math . Sqrt ( n ) ) + 1 ) ; ArrayList prime = new ArrayList ( ) ; simpleSieve ( limit , prime ) ;