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 = 1 of the Hardy–Ramanujan–Rademacher series for p(n),

\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) \sqrt{12}/(24n-1) of the term and approximates p(n) with relative error about e^{-t/2}. The precision of the exponential is increased by half the bit length of n for the argument reduction. Requires n \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-10-20).