§24.19(i) Bernoulli and Euler Numbers and Polynomials

Equations (24.5.3) and (24.5.4) enable
Bn and En to be computed by recurrence. For higher values
of n more efficient methods are available. For example, the tangent numbers
Tn 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).

For number-theoretic applications it is important to compute
B2⁢n(modp) for 2⁢n≤p-3; in particular to find the
irregular pairs(2⁢n,p) for which B2⁢n≡0(modp).
We list here three methods, arranged in increasing order of efficiency.

•

Tanner and Wagstaff (1987) derives a congruence (modp) for Bernoulli
numbers in terms of sums of powers. See also §24.10(iii).

and computes inverses modulo p of the left-hand side. Multisectioning
techniques are applied in implementations. See also
Crandall (1996, pp. 116–120).

•

A method related to “Stickelberger codes” is applied in
Buhler et al. (2001); in particular, it allows for an efficient search for
the irregular pairs (2⁢n,p). Discrete Fourier transforms are used in the
computations. See also Crandall (1996, pp. 120–124).