Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Bach, E.: A note on square roots in finite fields. IEEE Trans. on Information Theory 36(6), 1494–1498 (1990)
Bach, E., Shallit, J.O.: Algorithmic Number Theory: Efficient Algorithms, vol. 1. MIT Press, Cambridge (1996) (Solution to problem 5.52)
Bachmann, P.: Niedere Zahlentheorie, Teubner, Leipzig, vol. 1 (1902); Reprinted by Chelsea, New York (1968)
Brent, R.P.: Twenty years’ analysis of the binary Euclidean algorithm. In: Davies, J., Roscoe, A.W., Woodcock, J. (eds.) Millennial Perspectives in Computer Science: Proceedings of the 1999 Oxford - Microsoft Symposium in honour of Professor Sir Antony Hoare, Palgrave, New York, pp. 41–53 (2000), http://wwwmaths.anu.edu.au/~brent/pub/pub183.html
Daireaux, B., Maume-Deschamps, V., Vallée, B.: The Lyapunov tortoise and the dyadic hare. In: Proceedings of the 2005 International Conference on Analysis of Algorithms, DMTCS Proc. AD, pp. 71–94 (2005), http://www.dmtcs.org/dmtcs-ojs/index.php/proceedings/issue/view/81
Gauss, C.F.: Theorematis fundamentalis in doctrina de residuis quadraticis, demonstrationes et ampliatones novæ. Comm. Soc. Reg. Sci. Gottingensis Rec. 4 (presented February 10, 1817) (1818); Reprinted in Carl Friedrich Gauss Werke, Bd. 2: Höhere Arithmetik, Göttingen, pp. 47–64 (1876)
Knuth, D.E.: The Art of Computer Programming. In: Seminumerical Algorithms, 3rd edn., vol. 2, Addison-Wesley, Reading (1997)
Möller, N.: On Schönhage’s algorithm and subquadratic integer GCD computation. Mathematics of Computation 77(261), 589–607 (2008)
Schönhage, A.: Schnelle Berechnung von Kettenbruchentwicklungen. Acta Informatica 1, 139–144 (1971)
Schönhage, A.: Personal communication by email (December 2009)
Schönhage, A., Grotefeld, A.F.W., Vetter, E.: Fast Algorithms: A Multitape Turing Machine Implementation. BI-Wissenschaftsverlag, Mannheim (1994)
Shallit, J., Sorenson, J.: A binary algorithm for the Jacobi symbol. ACM SIGSAM Bulletin 27(1), 4–11 (1993), http://euclid.butler.edu/~sorenson/papers/binjac.ps
Stehlé, D., Zimmermann, P.: A binary recursive gcd algorithm. In: Buell, D.A. (ed.) ANTS 2004. LNCS, vol. 3076, pp. 411–425. Springer, Heidelberg (2004)
Vallée, B.: A unifying framework for the analysis of a class of Euclidean algorithms. In: Gonnet, G.H., Viola, A. (eds.) LATIN 2000. LNCS, vol. 1776, pp. 343–354. Springer, Heidelberg (2000)
Weilert, A.: Fast Computation of the Biquadratic Residue Symbol. Journal of Number Theory 96, 133–151 (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Brent, R.P., Zimmermann, P. (2010). An O(M(n) logn) Algorithm for the Jacobi Symbol. In: Hanrot, G., Morain, F., Thomé, E. (eds) Algorithmic Number Theory. ANTS 2010. Lecture Notes in Computer Science, vol 6197. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-14518-6_10
Download citation
DOI: https://doi.org/10.1007/978-3-642-14518-6_10
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-14517-9
Online ISBN: 978-3-642-14518-6
eBook Packages: Computer ScienceComputer Science (R0)