Large Prime Number Generation
- 30Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is Fermat's Little Theorem?
For a prime p and integer a not divisible by p, ap−1≡1(modp).
Or swipe the card
30 cards
What is Fermat's Little Theorem?
For a prime p and integer a not divisible by p, ap−1≡1(modp).
In Fermat's Little Theorem, what condition on a is necessary?
a must not be a multiple of p (i.e., a and p are coprime).
How does the Fermat Primality Test work?
Choose a base a<n. Compute an−1modn. If =1, n is composite; if =1, n may be prime.
In the Fermat Primality Test, what is a 'witness'?
A base a such that an−1≡1(modn), proving n is composite.
In the Fermat Primality Test, what is a 'liar'?
A base a such that an−1≡1(modn) even though n is composite.
Define Carmichael numbers.
Composite numbers n that satisfy an−1≡1(modn) for all a coprime to n.
Give an example of a Carmichael number.
561 = 3 × 11 × 17.
Why does base 42 act as a witness for composite 561 in the Fermat test?
Because 42 shares a factor (3) with 561, so 42560≡1(mod561).
Who discovered the first seven Carmichael numbers?
Václav Šimerka.
What did Paul Erdős conjecture about Carmichael numbers?
That there are infinitely many.
Who proved there are infinitely many Carmichael numbers and in what year?
Red Alford, Andrew Granville, and Carl Pomerance in 1994.
How does Miller's test improve upon Fermat's test?
It breaks the exponent an−1 into a sequence by repeatedly dividing the exponent by 2 until odd, allowing detection of composite numbers that satisfy the Fermat condition.
What are the two conditions of Miller's primality test for a base a?
(1) The final term in the sequence (an−1modn) must be 1. (2) Whenever a term in the sequence is 1, the previous term must be either 1 or n−1.
Why is the square root property important in Miller's test?
For a prime modulus p, the only square roots of 1 mod p are 1 and p−1. If the sequence shows a square root of 1 that is not ±1, then n must be composite.
Give an example of a Carmichael number that Miller's test correctly identifies as composite.
n=561 with base a=100. Sequence: 298, 166, 67, 1, 1. Final 1, but previous 67 is not 1 or 560, so condition (2) fails.
Show that Miller's test can still have liars. Give an example.
n=221, a=174. Sequence: 47, 220, 1. Conditions satisfied (final 1, previous 220 = n−1), but 221=13×17 is composite.
Under what assumption did Miller prove his test is deterministic (always correct)?
The Extended Riemann Hypothesis (ERH). If ERH holds, for any composite n, there is a witness base less than 2(lnn)2.
What is the Miller-Rabin primality test?
A probabilistic version of Miller's test that uses random bases. It determines primality with high probability by repeating the test.
For any odd composite number, what proportion of bases are witnesses in the Miller-Rabin test?
At least 75% (3/4).
What is the probability of a false positive (composite marked prime) after 10 random iterations of Miller-Rabin?
At most 1 in a million (0.0001%).
What role does Miller-Rabin play in internet security?
It is used to generate large prime numbers for encryption algorithms (e.g., RSA).
What is the Prime Number Theorem's estimate for the density of primes near a large integer N?
Approximately 1/ln(N).
Describe the basic algorithm for generating a large prime number.
(1) Pick a random n-digit number; (2) Test if it is prime (e.g., with Miller-Rabin); (3) If prime, output it; otherwise, repeat.
What is the expected number of random trials to find an n-digit prime?
About 2.3n trials (since density is ∼1/(2.3n)).
Why is the generation of large primes feasible for computers?
The Prime Number Theorem ensures a reasonable density; Miller-Rabin tests each candidate quickly (milliseconds). Thousands of trials take only minutes.
What is the AKS primality test?
A deterministic primality test invented in 2002 by Agrawal, Kayal, and Saxena. It is always correct but slower than Miller-Rabin.
What is modular exponentiation and why is it important?
An efficient way to compute abmodn without huge intermediate numbers. Used in all modular arithmetic in primality tests.
Who invented the Miller primality test?
Gary Miller, a PhD student at UC Berkeley in the early 1970s.
Who popularized the probabilistic version of Miller's test?
Michael Rabin, who published it in 1980.
What two conditions must hold for a base a to pass Miller's test for a candidate prime n?
(1) an−1≡1(modn); (2) In the sequence of repeated square roots, every square root of 1 encountered is either 1 or n−1.

Ask anything
We've read this whole study set, so questions about it get the best answers.