nmod_poly_minimal_irreducible
#include <flint/nmod_poly.h>void nmod_poly_minimal_irreducible(nmod_poly_t res, ulong n)sourceSets res to a monic irreducible polynomial of degree over the prime field , the modulus of res, with the least possible number of nonzero terms: a binomial if one exists, otherwise a trinomial, a tetranomial or a pentanomial. Throws FLINT_ERROR if none of these exists; it is conjectured that a tetranomial () or pentanomial () always does.
An irreducible binomial of degree exists if and only if every prime factor of divides , and if . Among the polynomials with the least number of terms the function returns the first in the following order. A trinomial comes before its monic reversal if . Writing with , the tuples are ordered lexicographically, which favours small coefficients (all 1 if possible) and then small degrees of the middle terms. Sparse moduli make reduction cheap, see _nmod_poly_divrem_newton_n_preinv. The choice of defining polynomials for finite fields is discussed in Defining polynomials.
Guides#
The FLINT team, “nmod_poly_minimal_irreducible (nmod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_poly/nmod_poly_minimal_irreducible.html (generated 2026-11-02).
@misc{flint-doc-nmod-poly-nmod-poly-minimal-irreducible,
author = {{The FLINT team}},
title = {{nmod\_poly\_minimal\_irreducible (nmod\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/nmod_poly/nmod_poly_minimal_irreducible.html},
note = {Generated 2026-11-02}
}