Computation of Tangent, Euler, and Bernoulli Numbers* By Donald E. Knuth and Thomas J. Buckholtz Abstract. Some elementary methods are described which may be used to cal- culate tangent numbers, Euler numbers, and Bernoulli numbers much more easily and rapidly on electronic computers than the traditional recurrence relations which have been used for over a century. These methods have been used to prepare an accompanying table which extends the existing tables of these numbers. Some the- orems about the periodicity of the tangent numbers, which were suggested by the tables, are also proved. 1. Introduction. The tangent numbers Tn, Euler numbers En, and Bernoulli numbers Bn, are defined to be the coefficients in the following power series: (1) tan z = To/0! + T&/V. + T2z2/2\ + • • • = Z Tnzn/n\ , (2) sec z = E0/0\ + Eiz/V. + E2z2/2\ +•••«= 5Z Enzn/n\ , (3) z/(ez - 1) = tfo/O! + Biz/1\ + ^2272! + ••• = £ Bnzn/n\ . Much of the older mathematical literature uses a slightly different notation for these numbers, to take account of the zero coefficients. Thus we find many papers where tan z is written Tiz + T2z3/3\ + T-¡zb/5\ + - - -, sec z is written Eo + Eiz2/2\ + E2z4/Al + ■■-, and z/ (e* - 1) is written 1 - z/2 + Biz2/2l - B^/Al + Bsz6/6l ••'. Some other authors have used essentially the notation defined above but with different signs; in particular our E2n is often accompanied by the sign ( —1)". In Section 2 we present simple methods for computing T„, En, and Bn which are readily adapted to electronic computers, and in Section 3 more details of the com- puter program are explained. A table of Tn and En for n ^ 120, and Bn for n ^ 250, is appended to this paper, thereby extending the hitherto published values of Tn for n á 60 [6], En for n á 100 [2, 3], and Bn for n ^ 220 [7, 4]. Using the methods of this paper it is not difficult to extend the tables much further, and the authors have submitted a copy of the values of Tn On gj 835), En (n ^ 808), Bn (n ^ 836) to the Unpublished Mathematical Tables repository of this journal. Section 4 shows how the formulas of Section 2 lead to some simple proofs of arithmetical properties of these numbers. 2. Formulas for Computation. The traditional method of calculating Tn and En is to use recurrence relations, such as the following: Let cos z = 2~2n^o Cnzn/n; Received February 6, 1967. * Supported in part by NSF Grant GP 3909. 663 License or copyright restrictions may apply to redistribution; see http://www.ams.org/journal-terms-of-use