FLINT3.7.0-dev

n_primes_next

Synopsis#include <flint/ulong_extras.h>
ulong n_primes_next(n_primes_t iter)source

Returns the next prime and advances the iterator. The first call returns 2.

n_primes_next reads small primes from the table flint_primes_small (or from the iterator's own extended copy). When that table is exhausted, it calls n_primes_jump_after, which sieves the next block of odd numbers with n_primes_sieve_range.

Cite this page

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