FLINT3.7.0-dev

partitions_leading_fmpz

Synopsis#include <flint/partitions.h>
void partitions_leading_fmpz(arb_t res, const fmpz_t n, slong prec)source

Sets res to the dominant part of the leading term k=1k = 1 of the Hardy–Ramanujan–Rademacher series for p(n)p(n),

1224n−1(1−1t)et,t=π24n−16,\frac{\sqrt{12}}{24n - 1} \left(1 - \frac{1}{t}\right) e^{t}, \qquad t = \frac{\pi \sqrt{24n - 1}}{6},

which omits the part e−t(1+1/t)12/(24n−1)e^{-t}(1 + 1/t) \sqrt{12}/(24n-1) of the term and approximates p(n)p(n) with relative error about e−t/2e^{-t/2}. The precision of the exponential is increased by half the bit length of nn for the argument reduction. Requires n≥1n \ge 1.

Cite this page

The FLINT team, “partitions_leading_fmpz (partitions.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/partitions/partitions_leading_fmpz.html (generated 2026-11-02).