FLINT3.7.0-dev

n_jacobi, n_jacobi_unsigned

Synopsis#include <flint/ulong_extras.h>
int n_jacobi(slong x, ulong y)source
int n_jacobi_unsigned(ulong x, ulong y)source

Returns the Jacobi symbol \left(\frac{x}{y}\right) for odd y (not checked), with a binary algorithm [ShaSor1993]. n_jacobi_unsigned accepts a full-limb x.

References#

  • [ShaSor1993] J. Shallit and J. Sorenson, "A binary algorithm for the Jacobi symbol", ACM SIGSAM Bulletin 27 (1993), 4–11
Cite this page

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