English

Efficient implementation of the Hardy-Ramanujan-Rademacher formula

Number Theory 2019-02-20 v2

Abstract

We describe how the Hardy-Ramanujan-Rademacher formula can be implemented to allow the partition function p(n)p(n) to be computed with softly optimal complexity O(n1/2+o(1))O(n^{1/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)p(10^{19}), an exponent twice as large as in previously reported computations. We also investigate performance for multi-evaluation of p(n)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.

Keywords

Cite

@article{arxiv.1205.5991,
  title  = {Efficient implementation of the Hardy-Ramanujan-Rademacher formula},
  author = {Fredrik Johansson},
  journal= {arXiv preprint arXiv:1205.5991},
  year   = {2019}
}

Comments

updated version containing an unconditional complexity proof; accepted for publication in LMS Journal of Computation and Mathematics

R2 v1 2026-06-21T21:10:06.506Z