Is 561 Prime?
December 16, 2024
The Fermat primality test fails on Carmichael numbers – composites that pass for every base. Miller-Rabin fixes this by inspecting the squaring chain that leads to Fermat’s result, and Rabin and Monier independently proved at most 1/4 of bases are strong liars for any composite. The Baillie-PSW test combines Miller-Rabin with a Lucas test probing a different algebraic structure; no counterexample has been found despite a bounty and exhaustive search below .
Is 561 prime? Trial division says no (). But check : you get 1, exactly what a prime would give. Try : also 1. Try any base coprime to 561: always 1. Every test of this form says 561 is prime.
561 is the smallest number with this property. It fools not just one unlucky test, but every instance of the oldest and most natural primality test. It took 340 years of fixes to nearly close the gap.
# Background
Given an arbitrary integer , how do you decide whether it’s prime?
The stakes are not abstract. RSA key generation requires finding two large primes and , typically 1024 bits each, so that their product is hard to factor. The security of RSA rests on the assumption that factoring is computationally infeasible, but that assumption is worthless if or is not actually prime. A composite that slips through primality testing produces a key that can be factored trivially. RSA, Diffie-Hellman, and most public-key cryptography depend on reliably generating large primes.
# Trial division
The oldest approach: to test whether is prime, try dividing it by every integer from 2 up to . If none divide evenly, is prime.
This works because if with , then . So we only need to check potential factors up to the square root. A standard optimization: after checking 2, only test odd divisors (or better, only test primes up to , but generating those primes is itself a sub-problem – the Sieve of Eratosthenes handles it for moderate bounds).
The complexity is divisions. For a 10-digit number, that is roughly 100,000 divisions – fast on current hardware. For a 300-digit number (a typical RSA prime), has 150 digits. There are approximately candidate divisors. At divisions per second, this would take about seconds. The universe is approximately seconds old.
The issue is that is exponential in the bit-length of . If has bits, then , and we need divisions. A polynomial-time algorithm would need operations for some constant . Trial division is correct and deterministic, but for cryptographic sizes it is useless. This is not a constant-factor problem that faster hardware will solve. The gap is exponential.
# The probabilistic trade
This gap (between what we need, testing 1024-bit numbers, and what deterministic methods can do in reasonable time) motivates a radical idea: accept a test that might be wrong.
A probabilistic primality test gives one of two answers: “definitely composite” or “probably prime.” In the language of randomized algorithms, this is a Monte Carlo algorithm: it always terminates in bounded time, but the answer might be wrong.The contrast is a Las Vegas algorithm, which always gives the correct answer but whose runtime is a random variable. ECPP (discussed below) is closer to the Las Vegas model: it always produces a correct certificate, but finding one can take unpredictable time. The naming is a gambling joke from the 1970s. The “probably” comes with a quantifiable error bound. If the probability of a false “probably prime” answer is less than , that is a smaller failure probability than a cosmic ray flipping a bit in your CPU during the computation. For engineering purposes, “probably prime with error ” is as good as “proven prime.”
The challenge is building a test with: (1) an error probability that decreases exponentially with the number of iterations, and (2) no blind spots: no class of composites that always fools the test regardless of how many iterations you run.
The first condition is achievable: run the test multiple times with independent random choices, and error probabilities multiply (shrinking exponentially). The second took 340 years from Fermat to Rabin, because the natural first attempt, the Fermat test, has exactly the blind spot we need to avoid.
# Fermat’s Little Theorem
In 1640, Pierre de Fermat stated a theorem that would become foundational to primality testing:
for any prime and integer not divisible by .
Consider the nonzero residues modulo . Multiplying each by (with ) permutes this set: the map is a bijection on . Therefore:
The left side is and the right side is . Since is prime, is invertible mod , giving .
The contrapositive gives us a primality test: if for some coprime to , then is definitely composite.
# The Fermat Primality Test
This observation leads to a simple probabilistic test:
- Pick a random base with
- Compute
- If the result is not 1, is composite
- If the result is 1, is probably prime
Step 2 uses modular exponentiation by repeated squaring, which runs in multiplications mod , each costing with schoolbook multiplication. Total: . This scales with the number of digits, not the magnitude, which is exactly what we need.
Note an asymmetry: the test can prove compositeness (if , is definitely composite) but can only suggest primality (if , might be prime). This one-sided error structure defines probabilistic primality testing. We will never get a false “composite” answer, only a false “probably prime.”
The weakness: composite numbers that pass this test exist.
# Pseudoprimes
A composite number is called a Fermat pseudoprime to base if .
For example, is a pseudoprime to base 2:
Why does this happen? The order of 2 modulo 11 is 10 (by Fermat’s little theorem, ), and the order of 2 modulo 31 is 5 (since ). Since and , we get modulo both 11 and 31, hence modulo by the Chinese Remainder Theorem.
This means the Fermat test with base 2 incorrectly identifies 341 as “probably prime.”
The pseudoprimes to base 2 below 1000 are just 341 and 561. They are rare (there are only 245 base-2 pseudoprimes below ), but their rarity is deceptive. It might suggest that testing multiple bases would catch all composites: if is a pseudoprime to base 2, surely it fails for base 3? Often yes. 341 fails for base 3. But 561, as the opening promised, does not fail for any base.
# Carmichael Numbers
A composite number that is a pseudoprime to every base coprime to it is called a Carmichael number – and 561 is the smallest.15Vaclav Simerka found several examples in 1885, publishing in Casopis pro pestovani mathematiky a fysiky, a Czech-language journal with limited circulation outside Bohemia. His priority was recovered over a century later by Kral, Loebl, and Matousek (2001). In 1899, Alwin Korselt characterized them: a composite is a Carmichael number if and only if:
- The number is square-free (no repeated prime factors)
- For every prime dividing , we have
Korselt knew of no examples. In 1910, Robert D. Carmichael independently discovered 561. Why does it work? , and:
- divides 560
- divides 560
- divides 560
The Fermat test fails completely on Carmichael numbers: no choice of base (coprime to ) will reveal their compositeness. For the Fermat test, Carmichael numbers are an unconditional blind spot. No amount of repetition helps.
Korselt’s criterion has an intuitive interpretation: it says that “pretends” to be prime by having its prime factors’ orders all divide . The Chinese Remainder Theorem then forces for all coprime to . The deception is structural, not coincidental.
# How many exist?
For decades, mathematicians wondered whether there are infinitely many Carmichael numbers. In 1994, Alford, Granville, and Pomerance proved there are:6 for sufficiently large , the number of Carmichael numbers up to exceeds . The proof is non-constructive, and the figure is a lower bound on the proved lower bound, not an estimate of the true density. Harman (2005) pushed the proved lower bound to , and Pinch’s exhaustive tabulation through shows the empirical count growing closer to – still far below Erdos’s conjecture that the count up to is , which remains open.
# Solovay-Strassen: The First Probabilistic Test
Carmichael numbers force a choice: either find a completely different kind of test, or accept that the Fermat test has an unconditional blind spot. In 1977, Robert Solovay and Volker Strassen found the first option.1 Their insight: check not just whether , but whether the path to 1 is consistent with primality. The tool is the Euler criterion, which connects modular exponentiation to the Legendre symbol.
Lemma (Euler criterion). For an odd prime and :
where is the Legendre symbol ( if is a quadratic residue mod , otherwise).
Proof sketch. Since is cyclic of order , we have , so is a square root of 1, hence . Write for a generator . Then . When is even, this is , so is a quadratic residue. When is odd, (the unique element of order 2), so is a non-residue.
The Solovay-Strassen test: pick a random , compute both and the Jacobi symbol (which can be computed in by reciprocity, without knowing the factorization of ). If they disagree, is composite.
Why this breaks the Carmichael barrier: a Carmichael number satisfies for all coprime to , but this does not force . The Jacobi symbol factors multiplicatively over the prime factors of , while the power does not decompose the same way. Solovay and Strassen proved that for any composite , at least half of all bases in are witnesses – the Euler criterion fails for them. This gives a error bound per round, worse than Miller-Rabin’s but sufficient to bypass Carmichael numbers entirely.
# Why Primes Are Algebraically Special
The Fermat test checks one property of primes: . Miller’s test checks a deeper property: not just what the final value is, but how it got there. Fermat asks “is the answer 1?” Miller asks “what is the square root of that 1?” In a prime field, the only square roots of 1 are . In a composite ring, there are others, and finding one proves compositeness. To understand why, we need a fact about the multiplicative group modulo a prime.
When is prime, under multiplication is a cyclic group of order . Every element is a power of some generator . A consequence: the equation has exactly two solutions: and . This is because , and in a field, each factor has at most one root.
For composite , is not cyclic in general – by the Chinese Remainder Theorem, it decomposes as a product of the groups for each prime factor. This product structure creates extra square roots of unity: elements with but . For example, , but .
These non-trivial square roots cannot exist modulo a prime but do exist modulo composites. Miller’s test detects them.
# Strong Pseudoprimes and Miller’s Test
In 1976, Gary Miller observed that we can strengthen the Fermat test by exploiting the algebraic structure above.2
Write where is odd. For a prime and base coprime to , one of the following must hold:
or
Why must one of these hold? Start from Fermat: . Now consider the squaring chain:
The last term is 1. Each term is the square of the previous. Working backwards from : if , then is a square root of 1 modulo . In a field (which is, since is prime), the polynomial has at most two roots: and . So either the previous term is also 1 (and we continue backwards) or it is (and we stop). Eventually we either reach or find some .
The critical point: for a composite , is not a field, and can have more than two solutions. For example, modulo , we have – a “non-trivial square root of unity.” This is the crack that Miller’s test exploits.
Worked example: , . Recall that 341 passes the Fermat test for base 2. Write , so and . The squaring chain is:
The chain went from 32 to 1 in one squaring. But and (since ). So 32 is a non-trivial square root of 1 modulo 341 – exactly the kind of witness that cannot exist modulo a prime. Miller’s test correctly identifies 341 as composite. The Fermat test missed this because it only checks the final value , discarding the information in the intermediate steps.
A composite number that passes this stronger test for base is called a strong pseudoprime to base . Unlike the Fermat test, there are no “strong Carmichael numbers”: no composite passes for all bases.
# The Miller-Rabin Test
In 1980, Michael Rabin made Miller’s test probabilistic and proved a key result:3 for any composite , at most of bases in are strong liars (bases for which passes the strong test). Louis Monier independently proved the same bound the same year.
Theorem (Rabin and Monier, 1980).3 If is an odd composite, the number of strong liars in is at most .
Proof sketch. Write with odd. By the Chinese Remainder Theorem, . A strong liar must have its squaring chain “look prime” – either or for some .
The key constraint: requires modulo every prime power factor simultaneously. But each factor has its own 2-adic structure ( with possibly different ), so the squaring chains must “synchronize” across all factors at the same step . The strong liars form a subgroup of . The synchronization constraint forces this subgroup to have index at least 4.
The worst case is with and , which gives exactly strong liars. All other composites have fewer.
This means:
- Each iteration has at most probability of being fooled
- After iterations with independent random bases, the error probability is at most
- With 40 iterations, the error probability is less than
But most composites are caught by the first random base. Damgard, Landrock, and Pomerance11 showed that for random odd -bit composites, the average-case error probability after rounds drops as for a constant , much faster than the worst-case . For 1024-bit numbers with even a single round, the average-case error probability is negligible.
Unlike the Fermat test, Miller-Rabin is not fooled by Carmichael numbers. For any Carmichael number , at least 75% of bases reveal its compositeness through the strong pseudoprime check. The “non-trivial square roots of unity” that exist in (but not in ) always provide witnesses.
# Implementation
Modular exponentiation by repeated squaring makes each round efficient. Here is a complete Miller-Rabin test in Python:
import random
def is_probable_prime(n, k=40):
"""Miller-Rabin with k rounds. False = composite, True = probably prime."""
if n < 2: return False
if n < 4: return True
if n % 2 == 0: return False
# Write n - 1 = 2^s * d with d odd
d, s = n - 1, 0
while d % 2 == 0:
d //= 2
s += 1
for _ in range(k):
a = random.randrange(2, n - 1)
x = pow(a, d, n) # a^d mod n
if x == 1 or x == n - 1:
continue
for _ in range(s - 1):
x = pow(x, 2, n) # square mod n
if x == n - 1:
break
else:
return False # composite witness found
return True
Python’s built-in three-argument pow(a, d, n) performs modular exponentiation by repeated squaring internally; it does not compute and then reduce. This makes the implementation efficient even for thousand-bit inputs. With rounds, the error probability is below , which is the typical choice for cryptographic key generation.
The for/else construct is Python-specific: the else clause executes only if the inner for loop completes without break, meaning none of the squarings produced , so is a witness to compositeness.
# Deterministic Variants
# Miller’s test under GRH
Miller’s original 1976 test was not probabilistic; it was deterministic, conditional on the extended Riemann hypothesis (ERH). Under ERH, Miller proved that for any composite , there exists a witness . This means you only need to test bases up to , giving a deterministic polynomial-time test – if ERH is true.
ERH remains unproven. The conditional result ties the difficulty of deterministic primality testing to the distribution of zeros of the Riemann zeta function.
# Known deterministic witness sets
Even without ERH, exhaustive computation has established that specific small sets of bases suffice for bounded ranges. These results turn Miller-Rabin into a deterministic test for numbers below each bound:
| Bound on | Sufficient bases |
|---|---|
The last bound is approximately . For 64-bit integers (), the first 12 primes as bases give a deterministic test. Alternatively, Jim Sinclair’s 7-element non-prime set is sufficient for the same range with one fewer test; this is what production implementations such as Rust’s num-prime and Go’s math/big use. This is how many implementations handle “small” numbers: no randomness needed, no probability of error, and the test runs in microseconds.
The smallest strong pseudoprime to base 2 is 2047 – which is why base alone suffices below that threshold.
# BPSW: the pragmatic gold standard
Miller-Rabin with random bases has no blind spots – but each round is probabilistic, and 40 rounds is slow for bulk prime generation. Can we do better with fewer tests by choosing them to be complementary? The Baillie-PSW test, introduced in 1980 by Robert Baillie,4 Carl Pomerance, John Selfridge, and Samuel Wagstaff,5 combines two tests that fail on disjoint sets of composites:
- A Miller-Rabin test to base 2
- A strong Lucas probable prime test (with a specific parameter selection method)
A composite that slips through Miller-Rabin base 2 typically fails the Lucas test. The power of BPSW comes from the near-disjointness of the two pseudoprime sets: the number-theoretic properties that make a number a strong pseudoprime (multiplicative order structure in ) are largely independent of those that make it a Lucas pseudoprime (quadratic residue structure in a degree-2 extension). For a composite to fool both tests simultaneously, it would need to “look prime” in two algebraically unrelated ways – and no such number has ever been found.
The Lucas test works in a different algebraic setting. Given parameters and with discriminant , define the Lucas sequences and via the recurrence . For a prime with Jacobi symbol , we have . The “strong” variant adds a squaring chain similar to Miller-Rabin. The parameter selection (Selfridge’s Method A: choose the first in the sequence such that ) is designed to maximize the independence between the Miller-Rabin and Lucas tests. The strong Lucas test has its own standalone error bound: Einsele and Paterson (2024) proved the strong liar fraction is at most , slightly worse than Miller-Rabin’s in isolation. A strong Lucas evaluation costs roughly 2–3× a single Miller-Rabin round, so BPSW’s two-test structure is not free, but the complementarity makes it far more effective than running two Miller-Rabin rounds.
No BPSW counterexample has ever been found. The original 1980 paper offered a $30 reward for a counterexample (from Pomerance, Selfridge, and Wagstaff).5 In 2021, Baillie, Fiori, and Wagstaff14 offered $2,000 for a counterexample to a strengthened variant. Neither reward has been claimed. Exhaustive search has verified that no counterexample exists below .
BPSW requires only two tests (one modular exponentiation + one Lucas computation), making it faster than running 40 rounds of Miller-Rabin. It is the default primality test in many implementations, including Mathematica, Maple, and SageMath.
# Beyond Miller-Rabin
Miller-Rabin and BPSW are probabilistic (or deterministic only for bounded ranges). For some applications (primality certificates, mathematical proofs, record-keeping) we need tests that prove primality unconditionally.
# AKS: theoretical breakthrough
In 2002, Manindra Agrawal, Neeraj Kayal, and Nitin Saxena proved that primality is in P:7The preprint circulated in August 2002. The journal publication in Annals of Mathematics appeared in 2004. Dates in citations refer to journal publication; “2002” in prose refers to when the result became known. there exists a deterministic polynomial-time algorithm that decides primality without any unproven hypothesis. AKS was the first test that is simultaneously general (works for all integers), polynomial-time, deterministic, and unconditionally correct. Every previous test satisfied at most three of these four properties: trial division is general, deterministic, and correct but exponential; Miller-Rabin is general, polynomial, and (conditionally) correct but either probabilistic or conditional on ERH; ECPP is general and polynomial but heuristic in its runtime analysis.
Kayal and Saxena were BTech students of Agrawal at IIT Kanpur. The preprint circulated in August 2002 and triggered an immediate burst of activity; Berrizbeitia, Lenstra-Pomerance, and Bernstein all submitted variants within weeks, rapidly tightening the complexity from the original .
The original algorithm runs in time. Lenstra and Pomerance8 improved this to in 2005. The key idea starts from a classical observation: if is prime, then the polynomial identity
holds in for all (this is essentially the Frobenius endomorphism). For composite , this identity generally fails. But checking it directly requires working with a polynomial of degree – which is as expensive as trial division.
AKS’s insight is to check this identity modulo a polynomial for a suitable small : verify in . Now the polynomials have degree at most , and can be chosen as or better.
The key lemma: if holds for , and has no prime factor , and is not a perfect power, then is prime. The proof constructs a group of residues in generated by and shows that is both large (from the many verified identities) and small (from the structure of the quotient ring), forcing to be prime. The total number of checks is polynomial in .
AKS is not used in practice. For 64-bit numbers, BPSW is orders of magnitude faster. For larger numbers, ECPP (below) is faster and also produces a certificate. AKS is a “galactic algorithm”: polynomial in theory, but with constants so large that Miller-Rabin with 64 rounds is faster by orders of magnitude even for 1024-bit inputs. Its significance is theoretical, settling a long-standing complexity question, not providing a practical tool.A galactic algorithm is one that is asymptotically optimal but whose constant factors are so large that it is never faster than simpler methods on any input that fits in the observable universe.
# ECPP: the practical gold standard for proven primes
Elliptic Curve Primality Proving (ECPP) was developed by Shafi Goldwasser and Joe Kilian in 1986,10 and refined into a practical algorithm by A. O. L. Atkin and Francois Morain in 1993.9 It runs in heuristic time and produces a primality certificate – a compact proof that anyone can verify much faster than it took to produce.
The core idea uses elliptic curves over . Given a point on an elliptic curve modulo , if we can show that the group order has a large prime factor , and certain conditions hold, then either is prime or has a very small factor (which we can check by trial division). The problem then reduces to proving is prime, a smaller instance of the same problem. This recursive structure terminates quickly.
The certificate is an Atkin-Goldwasser-Kilian-Morain certificate: a chain of elliptic curves and points that witnesses primality at each recursive step. Verification runs in polynomial time and does not require trusting the prover’s computation. This is the key distinction from probabilistic tests: ECPP does not say “probably prime with high confidence.” It says “here is a proof; check it yourself.” The certificate for a 10,000-digit prime might be a few megabytes, but verifying it takes minutes rather than the hours needed to produce it.
ECPP holds the record for the largest proven prime with a general-purpose algorithm: , a repunit with 109,297 digits. (Mersenne primes are tested with the deterministic Lucas-Lehmer test, which exploits their special form.)
# Comparison
| Test | Type | Complexity | Certainty | Practical use |
|---|---|---|---|---|
| Trial division | Deterministic | Proven | Small only | |
| Fermat | Probabilistic | Probable (with blind spots) | Obsolete | |
| Solovay-Strassen | Probabilistic | Error | Superseded by Miller-Rabin | |
| Miller-Rabin | Probabilistic | Error | General purpose | |
| BPSW | Probabilistic | No known counterexample | Default in most libraries | |
| Miller (GRH) | Deterministic (conditional) | Proven if ERH holds | Theoretical | |
| AKS | Deterministic | Proven | Not practical | |
| ECPP | Deterministic | heuristic | Proven + certificate | Largest proven primes |
Each successive test in this post exploits more algebraic structure of finite fields. The Fermat test checks multiplicative group order. Miller-Rabin probes the 2-Sylow subgroup via the squaring chain.The 2-Sylow subgroup is the largest subgroup whose order is a power of 2 – it’s what the squaring chain decomposes. When , the chain walks through this subgroup. The Lucas test probes quadratic extensions . ECPP uses the group structure of elliptic curves over .
# How Real Systems Test Primality
Real systems do not just run Miller-Rabin in a loop. The full pipeline for generating an RSA prime in OpenSSL (as of version 3.x) looks like this:
- Generate a random odd number of the desired bit length, with the top two bits set (to ensure the product has the right bit length).
- Check divisibility by a table of small primes (typically the first 2048 primes). This is trial division with a fixed bound, and it rejects about 80% of candidates cheaply.
- Run one round of Miller-Rabin with base 2.
- Run a Lucas test (the second half of BPSW).
- Depending on the security level and standard being followed, run additional Miller-Rabin rounds with random bases.
GMP’s mpz_probab_prime_p function follows a similar structure: trial division, then BPSW, then optional additional Miller-Rabin rounds requested by the caller.
The FIPS 186-5 standard (the current revision for US government systems) specifies Miller-Rabin with iteration counts that depend on the required error probability and the bit length of the candidate. For 1024-bit primes (half of a 2048-bit RSA modulus), FIPS 186-5 Appendix C.1 requires only 4 Miller-Rabin rounds to achieve the target error probability – far fewer than the generic 40-round recommendation – because the average-case error for near-random large primes drops dramatically faster than the worst-case bound.
libsodium, used widely for NaCl-family cryptography, relies on Ed25519 (which uses a fixed curve, not generated primes) for signatures, so primality testing is not in its hot path. But for applications that do need prime generation, libsodium defers to the OS or to a constant-time Miller-Rabin implementation.
The primality test itself is rarely the bottleneck. For a 2048-bit RSA modulus, the expected number of random candidates before finding a prime is approximately (by the prime number theorem). Each candidate undergoes trial division first, which filters out most composites in microseconds. Only the ~20% that survive trial division reach the expensive probabilistic test. End-to-end, generating both primes typically takes a few hundred milliseconds.
# Timing side channels
Every step in this pipeline must run in constant time. If the Miller-Rabin test takes longer for primes than for composites, an attacker observing timing can learn which candidates were selected as primes, narrowing the search space for factoring .
The attack surface is concrete. In the squaring chain, a composite is detected as soon as a witness is found; if the implementation returns early, the execution time leaks whether passed or failed. A prime survives all squaring steps; a composite caught at step returns faster. The timing difference is small (microseconds), but it is measurable across many key generation attempts, and it is enough to bias an attacker’s factoring search.
Production implementations defend with two techniques. First, Montgomery multiplication: all modular arithmetic uses Montgomery form, which replaces division by (whose cost depends on the value of ) with a fixed sequence of multiplications and bit shifts, making the cost of each operation independent of the operands’ values. Second, fixed iteration counts: the squaring loop always executes all steps regardless of whether a witness appeared at step . The result is the same number of multiplications for primes and composites.
A timing-leaky primality test is a broken primality test for cryptographic purposes, even if its mathematical properties are perfect.13
# Open Problems
# The BPSW question
The central open problem in practical primality testing: does a BPSW counterexample exist?
Heuristic arguments suggest counterexamples should exist but be astronomically rare. Pomerance has estimated12 that if they exist, the smallest might exceed . Exhaustive search has checked all numbers below with no counterexample found.
The $2,000 bounty (Baillie-Fiori-Wagstaff14) remains unclaimed. If no counterexample exists, proving this would likely require new techniques in analytic number theory. If one exists, finding it would likely require new techniques in constructive algebra.
Either resolution would be significant. In the meantime, BPSW occupies a peculiar status: universally trusted in practice, with no theoretical proof of correctness, and with heuristic arguments that counterexamples should exist but haven’t been found.
# References
[1] Solovay, R. & Strassen, V. (1977). “A Fast Monte-Carlo Test for Primality.” SIAM Journal on Computing, 6(1), 84-85. ↩
[2] Miller, G. L. (1976). “Riemann’s Hypothesis and Tests for Primality.” Journal of Computer and System Sciences, 13(3), 300-317. ↩
[3] Rabin, M. O. (1980). “Probabilistic Algorithm for Testing Primality.” Journal of Number Theory, 12(1), 128-138. ↩
[4] Baillie, R. & Wagstaff, S. S. (1980). “Lucas Pseudoprimes.” Mathematics of Computation, 35(152), 1391-1417. ↩
[5] Pomerance, C., Selfridge, J. L. & Wagstaff, S. S. (1980). “The Pseudoprimes to 25 x 10^9.” Mathematics of Computation, 35(151), 1003-1026. ↩
[6] Alford, W. R., Granville, A. & Pomerance, C. (1994). “There Are Infinitely Many Carmichael Numbers.” Annals of Mathematics, 139(3), 703-722. ↩
[7] Agrawal, M., Kayal, N. & Saxena, N. (2004). “PRIMES Is in P.” Annals of Mathematics, 160(2), 781-793. ↩
[8] Lenstra, H. W. & Pomerance, C. (2019). “Primality Testing with Gaussian Periods.” Journal of the European Mathematical Society, 21(4), 1229–1269. (Manuscript circulated 2005.) ↩
[9] Atkin, A. O. L. & Morain, F. (1993). “Elliptic Curves and Primality Proving.” Mathematics of Computation, 61(203), 29-68. ↩
[10] Goldwasser, S. & Kilian, J. (1986). “Almost All Primes Can Be Quickly Certified.” Proceedings of the 18th STOC, 316-329. ↩
[11] Damgard, I., Landrock, P. & Pomerance, C. (1993). “Average Case Error Estimates for the Strong Probable Prime Test.” Mathematics of Computation, 61(203), 177-194. ↩
[12] Pomerance, C. (1981). “On the Distribution of Pseudoprimes.” Mathematics of Computation, 37(156), 587-593. ↩
[13] Crandall, R. & Pomerance, C. (2005). Prime Numbers: A Computational Perspective. 2nd ed. Springer. ↩
[14] Baillie, R., Fiori, A. & Wagstaff, S. S. (2021). “Strengthening the Baillie-PSW Primality Test.” Mathematics of Computation, 90(330), 1931-1955. ↩
[15] Kral, D., Loebl, M. & Matousek, J. (2001). “Simerka as a predecessor of Carmichael.” Expositiones Mathematicae, 19(4), 377–381. ↩