KEYWORDS: Euler numbers, asymptotic inclusion, asymptotic approximation, OEIS A122045.

An approximation of the Euler numbers.

There is a standard asymptotic formula for the Euler numbers. For example at Mathworld or at the Digital Library of Mathematical Functions (NIST) (§24.11) one can find the formula one can find the formula

bernaasy

The present author found two inclusions for the Euler numbers which appear to be new. They are reported on this page. The bounds given comprise a simple but amazingly efficient approximation to the Euler numbers which I will call the 'cute approximation'.

A sharp inclusion of the Euler numbers.

Let En denote the Euler numbers. If n is even and n ≥ 20 then

eulerinclusion

For example the inclusion predicts

0.3887561841253070612..*10^2372 < |E(1000)| < 0.3887561841253070617..*10^2372.

And indeed |E(1000)| = 0.3887561841253070615..*10^2372.

Note that the factorial function is not referenced in these formulas.

A cute approximation of the Euler numbers.

The lower bound of the above inclusion can also be used as a convenient approximation for the Euler numbers. It then takes the form (assuming n even)

eulerapprox

Equivalently this formula can be stated as

eulerapprox

For example the standard approximation gives E(1000) ~ 0.38872..*10^2372, which amounts to 4 valid decimal numbers, whereas the last approximation gives for E(1000) an approximation with almost 18.2 valid decimal digits.

A sharper inclusion of the Euler numbers.

Even more powerful and convenient is the following asymptotic approximation of the Euler numbers.

euler5

bernapp

The first five terms of an stem from Stirling's formula (HMF 6.1.37).

Let n be an even integer.

Choosing X = 0 in the above formula gives a low bound for En for n ≥ 2.

Choosing X = 1 in the above formula gives a high bound for En for n ≥ 24.

Choosing X = 1/2 will give an approximation for En which is superior to the one given in the last paragraph.

For example n = 1000 and X = 1/2 gives

|E(1000)| ~ 0.38875618412530706152569...*10^2372, compared to
|E(1000)| = 0.38875618412530706152573...*10^2372.

This amounts to an approximation with almost 22 valid decimal digits.

Maple code snippet.

a := (s, X) -> (1+(1/12)*(1/s)+(1/288)*(1/s)^(2)-(139/51840)*(1/s)^(3)
-(571/2488320)*(1/s)^(4)+((24+X)/31250)/(s^5));
absEuler := (s, X) -> 4*exp(1/2)*(2*s/(Pi*exp(1)))^(s+1/2)*a(s, X);

# Test
Digits:=32:LOW:=0:MID:=1/2:HIG:=1:s:=600;
abs(euler(s)):   E := evalf(%);
absEuler(s,LOW): L := evalf(%);
absEuler(s,MID): M := evalf(%);
absEuler(s,HIG): H := evalf(%);
is(L<E),is(E<H);

The best approximation (so far).

More generally let us look at three asymptotic formulas for the logarithm of the Euler numbers.

  1. LogE0(r) = (1/2+r)*ln(r)-(1/2+r)*ln(pi)+(5/2+r)*ln(2)-r
  2. LogE1(r) = (1/2+r)*ln(r)-(1/2+r)*ln(pi)+(5/2+r)*ln(2)-r*
               (1-ln((120*r^2+9)/(120*r^2-1)))
  3. LogE2(r) = (1/2+r)*ln(r)-(1/2+r)*ln(pi)+(5/2+r)*ln(2)-r*
               (1-1/(12*r^2)*(1-1/(30*r^2)*(1-2857/(100*r)^2)))

We see that formula 2 as well as formula 3 are refinements of formula 1. We are now focusing on formula 3 (the trademark of which is the prime 2857) in its exponential form exp(LogE2(n)).

What makes this asymptotic approximation especially useful -- besides being a much better approximation than those given by the Digital Library of Mathematical Functions (see §24.11) -- is that the error of the approximation can be easily estimated.

In fact a convenient way to reason about the validity of an approximation formula is to give a lower bound for the number of exact decimal digits, i. e. to indicate the number of decimal digits which are guaranteed by the formula at least. In the case of exp(LogE2(n)) we have a good and simple way to express this bound:

     EddE(n) = 2*log(n) + 8.45    (valid for n ≥ 100).

For example in the test case Euler(3162) this bound says that 24.6 decimal digits of exp(logE2(n)) are guaranteed to be correct (the true value is 24.9).

To sum up: to compute an approximation to the Euler numbers E(n) with n ≥ 100 and n even compute exp(logE2(n)) and retain 2*log(n)+8.45 decimal digits of the result.

def EulerAsympt(n) :
    if n < 100 :
        print "Value error, n has to be ≥ 100"
        return 
    if is_odd(n) :
        return 0
    R = RealField(200)
    LogE = R((1/2+n)*ln(n)-(1/2+n)*ln(pi)+(5/2+n)*ln(2)
           -n*(1-1/(12*n^2)*(1-1/(30*n^2)*(1-2857/(100*n)^2))))
    E = (-1)^(n//2)*exp(LogE)
    Edd = floor(2*ln(n) + 8.45)    
    print SciFormat(E, Edd - 1)  # see SciFormat
    return E    
    
for n in (99..102): print n, EulerAsympt(n)
    99 → Value error, n has to be ≥ 100
   100 → 2.9035283466610975e138
   101 → 0
   102 → -1.212293737892921e142

print EulerAsympt(3162)
   -5.7970693922837497174057e9075

Note that the format function displays only valid digits. With Python/Sage the asymptotic formulas for the Euler numbers based on these formulas and the exact decimal digits of these approximations can be computed as follows.

AsyE0(n) = exp(LogE0(n))
AsyE1(n) = exp(LogE1(n))
AsyE2(n) = exp(LogE2(n))
    
EddE0(n) = -log10(abs(1-AsyE0(n)/abs(euler_number(n)))
EddE1(n) = -log10(abs(1-AsyE1(n)/abs(euler_number(n)))
EddE2(n) = -log10(abs(1-AsyE2(n)/abs(euler_number(n)))
EddEE(n) = 2*ln(n) + 8.45

ANF = 50
END = 1000
plot1 = list_plot([[2*n, EddE1(2*n)] for n in (ANF..END)], color='red')
plot2 = list_plot([[2*n, EddE2(2*n)] for n in (ANF..END)], color='blue')
plotE = list_plot([[2*n, EddEE(2*n)] for n in (ANF..END)], color='magenta')
show(plot2 + plot1 + plotE)

The plot below compares the number of exact decimal digits of the approximation (formula 3, blue curve) with the number of exact decimal digits guaranteed by this formula, 2*ln(n) + 8.45 (magenta curve). For comparison the red curve shows the exact decimal digits of formula 2. Formula 1 (given by DLMF/NIST) gives a poor approximation not worth to be shown.

Restating exp(LogE2(n)) in mathematical parlance, for n>0 even:


Note: The 'cute approximation' was given on Jan. 21 2007 by the present author. Here the announcement in the newsgroup de.sci.mathematik. The two inclusions were given on Jan. 22 2007, on this web page.

previous Asymptotic inclusions and approximations for the Bernoulli numbers.
next Asymptotic expansions of the factorial function.