Partition functions of three-dimensional quantum gravity and the black hole entropy