Skip to main content

An O(M(n) logn) Algorithm for the Jacobi Symbol

  • Conference paper
Algorithmic Number Theory (ANTS 2010)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6197))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bach, E.: A note on square roots in finite fields. IEEE Trans. on Information Theory 36(6), 1494–1498 (1990)

    Article  MATH  MathSciNet  Google Scholar 

  2. Bach, E., Shallit, J.O.: Algorithmic Number Theory: Efficient Algorithms, vol. 1. MIT Press, Cambridge (1996) (Solution to problem 5.52)

    MATH  Google Scholar 

  3. Bachmann, P.: Niedere Zahlentheorie, Teubner, Leipzig, vol. 1 (1902); Reprinted by Chelsea, New York (1968)

    Google Scholar 

  4. 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

  5. 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

  6. 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)

    Google Scholar 

  7. Knuth, D.E.: The Art of Computer Programming. In: Seminumerical Algorithms, 3rd edn., vol. 2, Addison-Wesley, Reading (1997)

    Google Scholar 

  8. Möller, N.: On Schönhage’s algorithm and subquadratic integer GCD computation. Mathematics of Computation 77(261), 589–607 (2008)

    Article  MATH  MathSciNet  Google Scholar 

  9. Schönhage, A.: Schnelle Berechnung von Kettenbruchentwicklungen. Acta Informatica 1, 139–144 (1971)

    Article  MATH  Google Scholar 

  10. Schönhage, A.: Personal communication by email (December 2009)

    Google Scholar 

  11. Schönhage, A., Grotefeld, A.F.W., Vetter, E.: Fast Algorithms: A Multitape Turing Machine Implementation. BI-Wissenschaftsverlag, Mannheim (1994)

    MATH  Google Scholar 

  12. 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

    Article  Google Scholar 

  13. 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)

    Google Scholar 

  14. 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)

    Chapter  Google Scholar 

  15. Weilert, A.: Fast Computation of the Biquadratic Residue Symbol. Journal of Number Theory 96, 133–151 (2002)

    MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics