The Baillie-PSW primality test combines tests for strong pseudoprimes and Lucas pseudoprimes (Baillie
and Wagstaff 1980, Pomerance et al. 1980, Pomerance 1984). There are a number
of variants, one particular version of which is given by the following algorithm
(Pomerance 1984):
1. Perform a base-2 strong pseudoprime test on . If this test fails, declare composite and halt. If this test succeeds, is probably prime. Proceed to step 2.
2. In the sequence 5, ,
9, , 13, ..., find the first number for which the Jacobi symbol. Then perform a Lucas pseudoprime test with
discriminant
on . If this test fails, declare composite. If it succeeds, is very probably prime.
Pomerance (1984) originally offered a prize of $30 for discovery of a composite number which passes this test, but the dollar amount of the offer was subsequently
raised to $620 (Guy 1994, p. 28).
As of Oct. 2026, no examples of composite numbers passing the test are known. All composite numbers
below
have been ruled out (Baillie et al. 2021). However, the elliptic
curve primality proving program PRIMO checks all intermediate probable
primes with this test, and if any were composite, the certification would necessarily
have failed. Based on the fact that this has not occurred in three years of usage,
PRIMO author M. Martin estimates that there is no composite less than
about
digits that can fool this test.