  We generalize a formula due to Macdonald that relates the singular Betti
numbers of $X^{n}/G$ to those of $X$, where $X$ is a compact manifold and $G$
is any subgroup of the symmetric group $S_{n}$ acting on $X^{n}$ by permuting
coordinates. Our result is completely axiomatic: in a general setting, given an
endomorphism on the cohomology $H^{\bullet}(X)$, it explains how we can
explicitly relate the Lefschetz series of the induced endomorphism on
$H^{\bullet}(X^{n})^{G}$ to that of the given endomorphism on $H^{\bullet}(X)$
in the presence of the K\"unneth formula with respect to a cup product. For
example, when $X$ is a compact manifold, we take the Lefschetz series given by
the singular cohomology with rational coefficients. On the other hand, when $X$
is a projective variety over a finite field $\mathbb{F}_{q}$, we use the
$l$-adic \'etale cohomology with a suitable choice of prime number $l$. We also
explain how our formula generalizes the P\'olya enumeration theorem, a
classical theorem in combinatorics that counts colorings of a graph up to given
symmetries, where $X$ is taken to be a finite set of colors. When $X$ is a
smooth projective variety over $\mathbb{C}$, our formula also generalizes a
result of Cheah that relates the Hodge numbers of $X^{n}/G$ to those of $X$. We
will also see that our result generalizes the following facts: 1. the
generating function of the Poincar\'e polynomials of symmetric powers of a
compact manifold $X$ is rational; 2. the generating function of the
Hodge-Deligne polynomials of symmetric powers of a smooth projective variety
$X$ over $\mathbb{C}$ is rational; 3. the zeta series of a projective variety
$X$ over $\mathbb{F}_{q}$ is rational. We also prove analogous rationality
results when we replace $S_{n}$ with $A_{n}$, alternating groups.
