FLINT3.7.0-dev

qsieve_next_A

Synopsis#include <flint/qsieve.h>
int qsieve_next_A(qs_t qs_inf)source

Finds the next value of A. If A has s > 3 factors, the first s - 1 are chosen at random among the smallest primes of the allowed range whose index is not divisible by 4 (the number of candidates being adjusted so that the products have about the right size), and the last factor is found by binary search among those with index divisible by 4, so that A is within a factor of two of its optimal value; values of A used before are rejected. With at most 3 factors, the next subset in lexicographic order is used. Returns 0 if no new value is found.

Cite this page

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