MATHEMATICS OF COMPUTATION, VOLUME 31, NUMBER 139 JULY 1977, PAGES 771-777 Computation of the Regular Continued Fraction for Euler's Constant By Richard P. Brent Abstract. We describe a computation of the first 20,000 partial quotients in the regular continued fractions for Euler's constant 7 = 0.577 . . . and exp(7) = 1.781 .... A preliminary step was the calculation of 7 and exp(7) to 20,700D. It follows from the continued fractions that, if 7 or exp(7) is of the form P/Q for integers P and Q, then \Q\> in1««««. 1. Introduction. The regular continued fraction of a real number jc is a (pos- sibly terminating) continued fraction of the form x = q0 + i/(qx +l/(q2 +•••)). where the q. are integers called "partial quotients", and q¡ > 0 if i > 0. We define relatively prime integers Pn and ß„ > 0 by PjQn = <?0 + 1/(?1 + l/(?2 + ** *+ 1/(1 + 1/?J •■•))• If necessary to avoid confusion, we write q¡(x) instead of q{, etc. Since it is not known whether Euler's constant 7 = 0.577 ... is rational or ir- rational, there is considerable interest in computing as many terms as possible in its regular continued fraction. We describe a computation of the partial quotients qx(j), q2(y), ■■. , cz20000(7), and give various statistics concerning them. Euler [12] suggested that G = exp(7) could be a more natural constant than 7. Thus, we also computed qx(G), . . . , <72oooo(^)- A preliminary step was the compu- tation of 7 and G to 20700 decimal places. These decimal values of 7 and G, along with the partial quotients q¡(y) and q¡(G) for i < 20000, have been deposited in the UMT file of this journal. 2. Historical Background. Early computations of 7 were performed by Euler, Mascheroni, and others: see Glaisher [13]. Adams [1] computed 7 to 263 places, and this result was not improved for 74 years until Wrench [20] extended the compu- tation to 328 places, and then Knuth [16] computed 1271 places. Adams, Wrench, and Knuth used the Euler-Maclaurin summation formula applied to the harmonic series, and Knuth found that the computation of the Bernoulli numbers required in the Received September 27, 1976. AMS (MOS) subject classifications (1970). Primary 10-04, 10A40; Secondary 10F20, 10F35, 65A05, 68A20. Key words and phrases. Euler's constant, Mascheroni's constant, gamma, rational approxima- tion, regular continued fractions, multiple-precision arithmetic, arithmetic-geometric mean, Khin- tchine's law, Levy's law, Gauss-Kusmin law. _ . ., _ ,„,_ . ., ... .. , _ . Copyright © 1977, American Mathematical Society 771 License or copyright restrictions may apply to redistribution; see https://www.ams.org/journal-terms-of-use