FLINT3.7.0-dev

arith_ramanujan_tau

Synopsis#include <flint/arith.h>
void arith_ramanujan_tau(fmpz_t res, const fmpz_t n)source

Sets res to \tau(n), the coefficient of q^n in \Delta(q) = q \prod_{k \ge 1} (1 - q^k)^{24}, or to 0 for n \le 0.

The function factors n, computes \tau(p) for the prime factors with arith_ramanujan_tau_series, and uses the multiplicativity of \tau and the recurrence \tau(p^{r+1}) = \tau(p) \tau(p^r) - p^{11} \tau(p^{r-1}). The cost is dominated by the series of length P + 1, where P is the largest prime factor of n, which must fit in a word.

Cite this page

The FLINT team, “arith_ramanujan_tau (arith.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arith/arith_ramanujan_tau.html (generated 2026-10-20).