FLINT3.7.0-dev

fmpz_is_prime_pocklington, fmpz_is_prime_morrison

Synopsis#include <flint/fmpz.h>
int fmpz_is_prime_pocklington(fmpz_t F, fmpz_t R, const fmpz_t n, nn_ptr pm1, slong num_pm1)source
int fmpz_is_prime_morrison(fmpz_t F, fmpz_t R, const fmpz_t n, nn_ptr pp1, slong num_pp1)source

The n - 1 test of Pocklington and the n + 1 test of Morrison for odd n (non-square for Morrison), given the num_pm1 (num_pp1) primes pm1 (pp1) dividing n - 1 (n + 1). Return 0 if n is composite. Otherwise they set F to the factored part of n \mp 1 and R to (n \mp 1)/F and return 1, which proves that every prime factor of n is \equiv 1 \pmod F (respectively \equiv \pm 1). This proves n prime if F \ge \sqrt n (respectively F > \sqrt n + 1).

Cite this page

The FLINT team, “fmpz_is_prime_pocklington, fmpz_is_prime_morrison (fmpz.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz/fmpz_is_prime_pocklington.html (generated 2026-10-20).