flint_mpn_remove_power_ascending
Synopsis
#include <flint/mpn_extras.h>mp_size_t flint_mpn_remove_power_ascending(mp_ptr x, mp_size_t xsize, mp_ptr p, mp_size_t psize, ulong * exp)sourceDivides (x, \mathit{xsize}) in place by the largest power p^v of (p, \mathit{psize}) that divides it, stores v in exp and returns the new length. x must be nonzero and p > 2. The divisibility is tested by ascending squares p, p^2, p^4, \ldots, which is efficient for large powers but has a high overhead, so it should not be used as the first stage of trial division.
Cite this page
The FLINT team, “flint_mpn_remove_power_ascending (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/flint_mpn_remove_power_ascending.html (generated 2026-10-20).
@misc{flint-doc-mpn-extras-flint-mpn-remove-power-ascending,
author = {{The FLINT team}},
title = {{flint\_mpn\_remove\_power\_ascending (mpn\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpn_extras/flint_mpn_remove_power_ascending.html},
note = {Generated 2026-10-20}
}