FLINT3.7.0-dev

n_nextprime

Synopsis#include <flint/ulong_extras.h>
ulong n_nextprime(ulong n, int proved)source

Returns the smallest prime greater than n. Throws an exception if it does not fit in a ulong. The flag proved has no effect: the result is always a proved prime.

Guides#

Cite this page

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