Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 2.4.8 (Strong pseudoprime algorithm)
Exercise 2.4.8 (Strong pseudoprime algorithm)
Note that the algorithmic form of the strong pseudoprime test does not terminate prematurely, then the last number examined is . Explain why it is not necessary to consider .
Answers
Proof. If the strong pseudoprime test does not terminate prematurely, it does not terminate at the step , therefore .
If , then is composite, since it does not verify the conclusion of Fermat theorem.
If , then is also composite, since , but .
In both cases is composite, thus it is useless to compute modulo .
This gives step 5 of the algorithm:
5. If the procedure has not already terminated, then is composite. □