Digital Library of Mathematical Functions
About the Project
NIST
24 Bernoulli and Euler PolynomialsComputation

§24.19 Methods of Computation

Contents

§24.19(i) Bernoulli and Euler Numbers and Polynomials

Equations (24.5.3) and (24.5.4) enable \mathop{B_{{n}}\/}\nolimits and \mathop{E_{{n}}\/}\nolimits to be computed by recurrence. For higher values of n more efficient methods are available. For example, the tangent numbers T_{n} can be generated by simple recurrence relations obtained from (24.15.3), then (24.15.4) is applied. A similar method can be used for the Euler numbers based on (4.19.5). For details see Knuth and Buckholtz (1967).

Another method is based on the identities

24.19.1N_{{2n}}=\frac{2(2n)!}{(2\pi)^{{2n}}}\left(\prod_{{p-1\divides 2n}}p\right)%
\left(\prod_{p}\frac{p^{{2n}}}{p^{{2n}}-1}\right),
24.19.2
D_{{2n}}=\prod_{{p-1\divides 2n}}p,
\mathop{B_{{2n}}\/}\nolimits=\dfrac{N_{{2n}}}{D_{{2n}}}.

If \widetilde{N}_{{2n}} denotes the right-hand side of (24.19.1) but with the second product taken only for p\leq\left\lfloor(\pi e)^{{-1}}2n\right\rfloor+1, then N_{{2n}}=\left\lceil\widetilde{N}_{{2n}}\right\rceil for n\geq 2. For proofs and further information see Fillebrown (1992).

For other information see Chellali (1988) and Zhang and Jin (1996, pp. 1–11). For algorithms for computing \mathop{B_{{n}}\/}\nolimits, \mathop{E_{{n}}\/}\nolimits, \mathop{B_{{n}}\/}\nolimits\!\left(x\right), and \mathop{E_{{n}}\/}\nolimits\!\left(x\right) see Spanier and Oldham (1987, pp. 37, 41, 171, and 179–180).

§24.19(ii) Values of \mathop{B_{{n}}\/}\nolimits Modulo p

For number-theoretic applications it is important to compute \mathop{B_{{2n}}\/}\nolimits\;\;(\mathop{{\rm mod}}p) for 2n\leq p-3; in particular to find the irregular pairs (2n,p) for which \mathop{B_{{2n}}\/}\nolimits\equiv 0\;\;(\mathop{{\rm mod}}p). We list here three methods, arranged in increasing order of efficiency.