A generating function for the trace of the Iwahori-Hecke algebra