  We describe an effective method for calculating certain infinite sums,
generalizations of the classical Bernoulli polynomials. As shown by Edward
Witten in his papers on two-dimensional gauge theories, the correlation
functions of two-dimensional topological Yang-Mills theory (or intersection
numbers on moduli spaces of flat connections) can be given in the form of such
infinite sums. Thus, in particular, our results give finite expressions for
these correlation functions in the case of arbitrary compact structure groups
G.
