This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.BitSet; | |
public class BailliePSWForJava { | |
public static boolean baillie_psw(long candidate){ | |
//Perform the Baillie-PSW probabilistic primality test on candidateS | |
//Check divisibility by a short list of primes less than 50 | |
for (long known_prime : new long []{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47}){ | |
if (candidate == known_prime) |