I am giving a talk on String theory to a math undergraduate audience. I am looking for a nice and suprising mathematical computation, maybe just a surprising series expansion, which is motivated by string theory and which can be motivated and explained relatively easily. Examples of what I have in mind are the results in Dijkgraaf's "Mirror symmetry and the elliptic curve", or the "genus expansion" of the MacMahon function (aka DT/GW for affine threespace), but I am not sure I can fit either into the time I have. Any thoughts?

Two counting problems  from my own very biased and personal viewpoint  that can perhaps be motivated:
But these can't beat calculating an actual partition function (as in Richard Eager's answer), unless you're trying to emphasize mathiness. 


Ginsparg's Applied Conformal Field Theory (hepth/9108028 section 7.6) has a nice proof of the Jacobi TripleProduct formula and Euler's pentagonal number theorem. The equalities can be interpreted as the equivalence between the partition function of a free chiral boson and the partition function of two chiral fermions on a torus. This is an example of bosonization and plays an important role in string theory. The proof can be explained without any reference to physics, but the crucial difference in statistics (Boson/Fermion) employed in the proof becomes obscured. 


I've given a talk about the equivalence between 1+1 TQFTs and Frobeneus algebras to an undergraduate audience with great success. It has great pictures and a clear, beautiful idea. The "computation" can then be the beautiful formula for the number of degree $d$ covers of a genus $g$ Riemann surface as a sum over irreducible representations of the symmetric group $S_d$ $$Z(g)=\sum _{R} \left(\frac{d!}{\dim(R)}\right)^{2g2}$$ That last computation requires that your audience knows some representation theory of finite groups, but that might be true for the Oxford undergrads. 


I agree that computing partition functions has many pretty applications. My favorite is the use of Jacobi's abstruse identity between theta functions, $\theta_3^4\theta_4^4=\theta_2^4$, to show the equality between the number of bosons and fermions in open superstring theory as required by supersymmetry. This is explained in sec 4.3 of "Superstring Theory" by Green, Schwarz and Witten. Another short calculation which quickly gets to the heart of the connection between string theory and gravity is the demonstration that bosonic string theory contains a massless spin two excitation. One way to do this requires regularizing a divergent zero point energy via $\sum_{n=1}^\infty n \rightarrow \sum_{n=1}^\infty n^{s}$ and then analytically continuing to $s=1$ to obtain $\zeta(1)=1/12$. See sec 2.3 of GSW. 


Maybe derive the Polyakov formula? Like KConrad says, whether it can be understood on an undergraduate level depends a lot on your presentation and the level of the undergraduates. But the basic idea behind the formula, if I remember correctly, can all be explained using a little bit of Riemannian geometry/representation theory plus a bit of complex analysis. (I recently saw a talk where it was perfectly understandable and impressive for masterslevel students.) (You can also segue into explaining why the universe is 26 dimensional.) 


Derive the Casimir Energy in Bosonic String Theory. You start with the $\hat L_0$ operator and get rid of the nonvacuum $\displaystyle\frac{\alpha_0^2}{2}+\sum_{n=1}^\infty\alpha_{n}\cdot\alpha_n$, then you use a Ramanujam sum to do $\zeta$function renormalisation, from which you find out that the vacuum energy denoted by $\varepsilon_0$ is $$\varepsilon_0=\frac{d2}{24}$$ However, the most interesting part comes when you go around deriving the critical dimension of Bosonic String Theory. After which, the expression surprisingly simplifyies to a $1$. For a more detailed derivation of the above stuff, see these lecture notes/. (Section 4) (Equation 4.54.10) 

