FLINT3.7.0-dev

_aprcl_is_prime_jacobi_additional_test

Synopsis#include <flint/aprcl.h>
int _aprcl_is_prime_jacobi_additional_test(const fmpz_t n, ulong p)source

The additional test of step 5 for a prime p \mid R for which (\mathcal L_p) was not established: looks for a prime q \equiv 1 \pmod{2p} (with 4 \| q - 1 if p = 2) such that n^{(q-1)/p} \not\equiv 1 \pmod q and checks that the corresponding h is a primitive root of unity (and for p = 2 that q^{(n-1)/2} \equiv -1 \pmod n). Returns 2 if n is proved composite, 1 if the condition holds, and 0 if no suitable q was found.

Cite this page

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