Partition Functions of Three-Dimensional Quantum Gravity and the Black Hole Entropy