@@ -0,0 +1,1874 @@
+//  Copyright 2016 The Sawdust Open Source Project%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//     http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A//%0A%0Apackage arithmetic.prime;%0A%0Aimport java.util.Arrays;%0A%0A/**%0A * %3Ca href=%22http://www.geeksforgeeks.org/sieve-of-eratosthenes/%22%3E Sieve of Eratosthenes %3C/a%3E%3Cbr%3E%0A * %3Ca href=%22https://www.mkyong.com/java/how-to-determine-a-prime-number-in-java/%22%3E primeSieve %3C/a%3E%0A */%0Apublic class IsPrime %7B%0A    boolean isPrime(int n) %7B%0A        //check if n is a multiple of 2%0A        if (n %25 2 == 0) %7B%0A            return false;%0A        %7D%0A        //if not, then just check the odds%0A        for (int i = 3; i * i %3C= n; i += 2) %7B%0A            if (n %25 i == 0) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return true;%0A    %7D%0A    %0A    boolean%5B%5D isPrimes = new boolean%5B10000%5D;%0A%0A    public void fillSieve() %7B%0A        Arrays.fill(isPrimes, true);%0A        isPrimes%5B0%5D = isPrimes%5B1%5D = false;       // 0 and 1 are NOT prime.%0A        for (int num = 2; num %3C isPrimes.length; num++) %7B%0A            //if the number is prime, then go through all its multiples and make their values false.%0A            if (isPrimes%5Bnum%5D) %7B%0A                for (int multiple = 2; num * multiple %3C isPrimes.length; multiple++) %7B%0A                    isPrimes%5Bnum * multiple%5D = false;%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%0A    public boolean primeSieve(int n) %7B%0A        return isPrimes%5Bn%5D;%0A    %7D%0A%7D%0A

Is prime?