Skip to content

An O(M(n) log n) algorithm for the Jacobi symbol

Citations of this article
Mendeley users who have this article in their library.
Get full text


The best known algorithm to compute the Jacobi symbol of two n-bit integers runs in time O(M(n)logn), using Schönhage's fast continued fraction algorithm combined with an identity due to Gauss. We give a different O(M(n)logn) algorithm based on the binary recursive gcd algorithm of Stehlé and Zimmermann. Our implementation - which to our knowledge is the first to run in time O(M(n)logn) - is faster than GMP's quadratic implementation for inputs larger than about 10000 decimal digits. © 2010 Springer-Verlag Berlin Heidelberg.




Brent, R. P., & Zimmermann, P. (2010). An O(M(n) log n) algorithm for the Jacobi symbol. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 6197 LNCS, pp. 83–95).

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free