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 τ(n)\tau(n), the coefficient of qnq^n in Δ(q)=q∏k≥1(1−qk)24\Delta(q) = q \prod_{k \ge 1} (1 - q^k)^{24}, or to 0 for n≤0n \le 0.

The function factors nn, computes τ(p)\tau(p) for the prime factors with arith_ramanujan_tau_series, and uses the multiplicativity of τ\tau and the recurrence τ(pr+1)=τ(p)τ(pr)−p11τ(pr−1)\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+1P + 1, where PP is the largest prime factor of nn, 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-11-02).