5.5.13 Test of pseudo-primality: is_pseudoprime
A pseudo-prime is a number with a large probability of being
prime (cf. Rabin’s Algorithm and Miller-Rabin’s Algorithm in the
Algorithmic part (menu
Help▸Manuals▸Programming)).
For numbers less than 1014, pseudo-prime and prime are
equivalent.
The is_pseudoprime command is a test for a pseudo-prime.
- is_pseudoprime takes one argument:
n, an integer.
- is_pseudoprime(n) returns 0, 1 or
2.
- If it returns 0, then n is not prime.
- If it returns 1, then n is a prime.
- If it returns 2, then n is pseudo-prime (most
probably prime).
Examples