This question is a variation of Exercize 1.2.3.34 from the Book
The Art of Computer Programming Vol. 1, by Prof. D. Knuth, page 36.
Prove that
This is a special case of the more general formula:
The formula can be proven using the residue theorem.
Marco Corvi - 2003