boolean[] seiveOfEnthorism(int n) {
if(n <= 1)
return new boolean[0];
boolean prime[] = new boolean[n + 1];
Arrays.fill(prime, true);
prime[0] = prime[1] = false;
int sqr = (int)Math.sqrt(n);
for(int i = 2; i <= sqr; i++) {
if(prime[i]) {
int j = 2;
while(i * j <= n) {
prime[i * j] = false;
j++;
}
}
}
return prime;
}