n_factor_trial, n_factor_trial_range
Synopsis
#include <flint/ulong_extras.h>ulong n_factor_trial(n_factor_t * factors, ulong n, ulong num_primes)sourceTrial division by the first num_primes primes (starting at the prime with index start). Factors found are added to factors, which must be initialised; the unfactored cofactor is returned.
The functions call n_compute_primes as needed and divide with n_remove2_precomp using the cached double inverses. They stop as soon as the square of the current prime exceeds the cofactor.
Cite this page
The FLINT team, “n_factor_trial, n_factor_trial_range (ulong_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ulong_extras/n_factor_trial.html (generated 2026-10-20).
@misc{flint-doc-ulong-extras-n-factor-trial,
author = {{The FLINT team}},
title = {{n\_factor\_trial, n\_factor\_trial\_range (ulong\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/ulong_extras/n_factor_trial.html},
note = {Generated 2026-10-20}
}