FLINT3.7.0-dev

_arith_bernoulli_number_vec_multi_mod

Synopsis#include <flint/arith.h>
void _arith_bernoulli_number_vec_multi_mod(fmpz * num, fmpz * den, slong n)source

Sets the numerators and denominators of B_0, \ldots, B_{n-1} by power series inversion modulo word-size primes and Chinese remaindering.

The function inverts

\frac{\cosh(x) - 1}{x^2} = \sum_{k \ge 0} \frac{x^{2k}}{(2k+2)!}, \qquad \frac{x^2}{\cosh(x) - 1} = \sum_{k=0}^{\infty} \frac{(2-4k) B_{2k}}{(2k)!} x^{2k}

modulo enough primes of \mathtt{FLINT\_BITS} - 1 bits to determine the numerators (bounded by arith_bernoulli_number_size plus the size of the denominator), which saves half of the work compared with x/(e^x-1) since the odd terms vanish [BuhlerCrandallSompolski1992]. The numerators are recovered by Chinese remaindering with a comb that uses only as many primes as each entry needs. The cost is O(n^2 \log^{O(1)} n).

References#

  • [BuhlerCrandallSompolski1992] Buhler, J.P. and Crandall, R.E. and Sompolski, R.W. : Irregular primes to one million : Math. Comp. 59:2000 (1992) 717–722
Cite this page

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