|
|
|
@ -6,7 +6,7 @@ import java.util.HashSet;
@@ -6,7 +6,7 @@ import java.util.HashSet;
|
|
|
|
|
public class Sieve { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Find all prime numbers below n^2 and return as longs. |
|
|
|
|
/** Find all prime numbers below n and return as longs. |
|
|
|
|
*/ |
|
|
|
|
public static List<Long> primeSieveLong(int n) { |
|
|
|
|
|
|
|
|
@ -41,7 +41,7 @@ public class Sieve {
@@ -41,7 +41,7 @@ public class Sieve {
|
|
|
|
|
return primes; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** Find all prime numbers below n^2 and return as integers. |
|
|
|
|
/** Find all prime numbers below n and return as integers. |
|
|
|
|
*/ |
|
|
|
|
public static List<Integer> primeSieveInt(int n) { |
|
|
|
|
|
|
|
|
@ -76,7 +76,7 @@ public class Sieve {
@@ -76,7 +76,7 @@ public class Sieve {
|
|
|
|
|
return primes; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** Find all prime numbers below n^2 and return as a Set<Long>. |
|
|
|
|
/** Find all prime numbers below n and return as a Set<Long>. |
|
|
|
|
*/ |
|
|
|
|
public static Set<Long> primeSieveSet(int n) { |
|
|
|
|
|
|
|
|
|