FLINT3.7.0-dev

aprcl_is_prime_gauss, aprcl_is_prime_gauss_min_R

Synopsis#include <flint/aprcl.h>
int aprcl_is_prime_gauss(const fmpz_t n)source
int aprcl_is_prime_gauss_min_R(const fmpz_t n, ulong R)source

Return 1 if n is prime and 0 otherwise, using the Gauss sum test in the form described by Schoof [Sch2008], with the minimum value R respectively 180. If the conditions (\mathcal L_p) cannot be verified, aprcl_is_prime_gauss retries with R multiplied by 2, 3 and 5 before throwing an exception. This version is much slower than the Jacobi sum test.

References#

  • [Sch2008] R. Schoof. Four primality testing algorithms. In: J. P. Buhler and P. Stevenhagen (eds.), Algorithmic Number Theory, MSRI Publications 44, Cambridge University Press, 2008, 101–126.
Cite this page

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