Summing the geometric series and generating functions

Ivan Cnop
Vrije universiteit Brussel
icnop@vub.ac.be

A geometric series

We know the sum of a geometric series and its partial sums

(∑_(j = 0)^∞) (x^j)                      (∑_(j = 
                0)^n)(x^j)

For  |x|  small enough these are

(1/(1 - x))                        ((1 - (x^(n + 1)))/(1 - x))

and they are the generating function for the sequence    1,1,1,1,1,1,1,1,1,1,1,....
We next try to sum the series   that is the generating function for   succesive   k th powers of natural numbers   j  :

(∑_(j = 0)^∞) (j^k) (x^j)

We suspect it may be another fraction with a power of   1-x   in the denominator.
The numerator will be called  a Euler polynomial, and its coefficients are called Euler coefficients.

Mathematica knows these:

Table[Sum[j^k*x^j, {j, 0, Infinity}], {k, 0, 12}]//TableForm

Recursive definition of  Euler polynomials

These functies are defined by successive derivatives and multiplication by   x   .

Clear[f, l]

f[0, x_] := 1/(1 - x)

f[j_, x_] := f[j, x] = x D[f[j - 1, x], x]

l[j_] := 
      CoefficientList[
        Series[(f[j, x] (1 - x)^(j + 1)), {x, 0, j}], 
        x]

l[4]

But this is slow due to the  Series  computation:

Timing[l[10]]

Last[%] // TableForm

MemoryInUse[]

Timing[l[12]]

MemoryInUse[]

Better definition of  Euler polynomials

Working with poynomials

If we know these functions are a polynomial divided by a power of    (1-x)   , we can speed up the definition:

Clear[f, l]

f[0, x_] := 1/(1 - x)

f[j_, x_] := f[j, x] = Together[x D[f[j - 1, x], x]]

l[j_] := 
      CoefficientList[Together[(f[j, x] (1 - x)^(j + 1))], 
        x]

l[4]

This is fast and memory efficient:

Timing[l[10]]

MemoryInUse[]

First[Timing[l[45]]]

A "half circle" of Euler coefficients:

Last[Timing[l[45]]] // TableForm

MemoryInUse[]

More Euler coefficients:

After reducing Font Size we can write coefficienten of degree 100 :

Last[Timing[l[100]]] // TableForm

MemoryInUse[]

First[Timing[l[200]]]

MemoryInUse[]

First[Timing[l[300]]]

But such large numbers only have a meaning in a logaritmic scale:

Last[Timing[N[Log[l[300]]]]] // TableForm

Writing these coefficients out would put some 150000 digits on the screen.

Assignments

Look for EulerE in Help.

Benchmark your computer by comparing the above timings.