Skip to main content
×
Home
    • Aa
    • Aa

Efficient implementation of the Hardy–Ramanujan–Rademacher formula

  • Fredrik Johansson (a1)
Abstract
Abstract

We describe how the Hardy–Ramanujan–Rademacher formula can be implemented to allow the partition function p(n) to be computed with softly optimal complexity O(n1/2+o(1)) and very little overhead. A new implementation based on these techniques achieves speedups in excess of a factor 500 over previously published software and has been used by the author to calculate p(1019), an exponent twice as large as in previously reported computations. We also investigate performance for multi-evaluation of p(n), where our implementation of the Hardy–Ramanujan–Rademacher formula becomes superior to power series methods on far denser sets of indices than previous implementations. As an application, we determine over 22 billion new congruences for the partition function, extending Weaver’s tabulation of 76 065 congruences. Supplementary materials are available with this article.

    • Send article to Kindle

      To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle.

      Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

      Find out more about the Kindle Personal Document Service.

      Efficient implementation of the Hardy–Ramanujan–Rademacher formula
      Available formats
      ×
      Send article to Dropbox

      To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your Dropbox account. Find out more about sending content to Dropbox.

      Efficient implementation of the Hardy–Ramanujan–Rademacher formula
      Available formats
      ×
      Send article to Google Drive

      To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your Google Drive account. Find out more about sending content to Google Drive.

      Efficient implementation of the Hardy–Ramanujan–Rademacher formula
      Available formats
      ×
Copyright
References
Hide All
[1]Ankeny N., ‘The least quadratic non residue’, Ann. of Math. (2) 55 (1952) no. 1, 6572.
[2]Apostol T., Modular functions and Dirichlet series in number theory, 2nd edn (Springer, New York, 1997).
[3]Borwein J. and Bailey D., Mathematics by experiment: plausible reasoning in the 21st century (A K Peters, Wellesley, MA, 2003) 137.
[4]Borwein J. and Borwein P., Experimental and computational mathematics: selected writings (Perfectly Scientific Press, Portland, OR, 2010) 250.
[5]Brent R. and Zimmermann P., Modern computer arithmetic (Cambridge University Press, New York, 2011).
[6]Bruinier J. and Ono K., ‘Algebraic formulas for the coefficients of half-integral weight harmonic weak Maass forms’, Preprint, 2011, arXiv.org/abs/1104.1182.
[7]Calkin N., Davis J., James K., Perez E. and Swannack C., ‘Computing the integer partition function’, Math. Comp. 76 (2007) no. 259, 16191638.
[8]Cipolla M., ‘Un metodo per la risoluzione della congruenza di secondo grado’, Napoli Rend. 9 (1903) 153163.
[9]Crandall R. and Pomerance C., Prime numbers: a computational perspective (Springer, New York, 2005) 99103.
[10]Erdős P., ‘Remarks on number theory. I’, Mat. Lapok 12 (1961) 1017.
[11]Fousse A., Hanrot G., Lefèvre V., Pélissier P. and Zimmermann P., ‘MPFR: A multiple-precision binary floating-point library with correct rounding’, ACM Trans. Math. Software 33, no. 2, 2007, http://www.mpfr.org/.
[12] The GMP development team, ‘Computing billions of π digits using GMP’, http://gmplib.org/pi-with-gmp.html.
[13] The GMP development team, ‘GMP: the GNU multiple precision arithmetic library’, http://gmplib.org/.
[14]Hagis P. Jr, ‘A root of unity occurring in partition theory’, Proc. Amer. Math. Soc 26 (1970) no. 4, 579582.
[15]Hardy G. H. and Ramanujan S., ‘Asymptotic formulae in combinatory analysis’, Proc. Lond. Math. Soc. 17 (1918) 75115.
[16]Hart W., ‘Fast library for number theory: an introduction’, Mathematical software – ICMS 2010, Lecture Notes in Computer Science 6327, 88–91, http://www.flintlib.org.
[17]Hart W., ‘A one line factoring algorithm’, J. Aust. Math. Soc. 92 (2012) 6169.
[18]Higham N., Accuracy and stability of numerical algorithms, 2nd edn (SIAM, Philadelphia, 2002).
[19] Intel corporation, Pentium processor family developer’s manual. Volume 3: architecture and programming manual, 1995, http://www.intel.com/design/pentium/MANUALS/24143004.pdf.
[20]Knuth D., ‘Notes on generalized Dedekind sums’, Acta Arith. 33 (1977) 297325.
[21]Knuth D., Fascicle 3: generating all combinations and partitions, The Art of Computer Programming, vol. 4 (Addison-Wesley, 2005).
[22]Lehmer D., ‘On the series for the partition function’, Trans. Amer. Math. Soc. 43 (1938) no. 2, 271295.
[23]Lehmer D., ‘On a conjecture of Ramanujan’, J. Lond. Math. Soc. 11 (1936) 114118.
[24]Lehmer D., ‘On the Hardy–Ramanujan series for the partition function’, J. Lond. Math. Soc. 3 (1937) 171176.
[25] The MPIR development team, ‘MPIR: multiple precision integers and rationals’, http://www.mpir.org.
[26]Odlyzko A., ‘Asymptotic enumeration methods’, Handbook of combinatorics 2 (eds Graham R., Grötschel M. and Lovász L.; Elsevier, The Netherlands, 1995) 10631229, http://www.dtc.umn.edu/∼odlyzko/doc/asymptotic.enum.pdf.
[27] OEIS Foundation Inc, ‘The on-line encyclopedia of integer sequences’, 2011, http://oeis.org/A000041.
[28]Ono K., ‘The distribution of the partition function modulo m’, Ann. of Math. (2) 151 (2000) 293307.
[29] The Pari/GP development team, ‘Pari/GP, Bordeaux’, 2011, http://pari.math.u-bordeaux.fr/.
[30]Pollack P., ‘The average least quadratic nonresidue modulo m and other variations on a theme of Erdős’, J. Number Theory 132 (2012) no. 6, 11851202.
[31]Rademacher H., ‘On the partition function p(n)’, Proc. Lond. Math. Soc. 43 (1938) 241254.
[32]Rademacher H. and Whiteman A., ‘Theorems on Dedekind sums’, Amer. J. Math. 63 (1941) no. 2, 377407.
[33]Shanks D., ‘Five number-theoretic algorithms’, Proceedings of the Second Manitoba Conference on Numerical Mathematics, 1972, 51–70.
[34]Stein W. and The Sage development team, ‘Sage: open source mathematics software’, http://www.sagemath.org.
[35] Sun Microsystems Inc, ‘FDLIBM version 5.3’, http://www.netlib.org/fdlibm/readme.
[36]Tonelli A., ‘Bemerkung über die Auflösung quadratischer Congruenzen’, Göttinger Nachrichten (1891) 344346.
[37]Watkins W. and Zeitlin J., ‘The minimal polynomial of cos (2π/n)’, Amer. Math. Monthly 100 (1993) no. 5, 471474.
[38]Weaver R., ‘New congruences for the partition function’, J. Ramanujan 5 (2001) 5363.
[39]Whiteman A., ‘A sum connected with the series for the partition function’, Pacific J. Math. 6 (1956) no. 1, 159176.
[40] Wolfram Research Inc., ’Some notes on internal implementation’, Mathematica documentation center, 2011, http://reference.wolfram.com/mathematica/note/SomeNotesOnInternalImplementation.html .
[41]Zimmermann P., The bit-burst algorithm, Slides presented at computing by the numbers: algorithms, precision, and complexity, Berlin, 2006, http://www.loria.fr/∼zimmerma/talks/arctan.pdf.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

LMS Journal of Computation and Mathematics
  • ISSN: -
  • EISSN: 1461-1570
  • URL: /core/journals/lms-journal-of-computation-and-mathematics
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×
MathJax

Keywords:

Metrics

Full text views

Total number of HTML views: 7
Total number of PDF views: 176 *
Loading metrics...

Abstract views

Total abstract views: 542 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 22nd October 2017. This data will be updated every 24 hours.