TITLE: What are applications of number theory in physics?
QUESTION [12 upvotes]: I was reading Goro Shimura's The Map of My Life.
He wrote the following quote in the book.
It made me come up with the title question.
In particular, is there any application of the theory of modular forms in physics?

A well known math-physicist Eugene Wigner was in our department,
  and so I occasionally talked with him. He was pompous
  and took himself very seriously. That is the impression shared by
  all those who talked with him. At a departmental party, he asked
  me what kind of mathematics I was doing. He asked that question
  as if he met me for the first time. At that time I had been a full
  professor and his colleague at least for six years, perhaps more. I
  told him vaguely, “Well, mainly things related to modular forms.”
  Then he said, “Oh, modular forms; we physicists don’t need such”
  in a very contemptuous tone.
  I can add that there are some physicists who are interested
  in modular forms. Once Edward Witten attended my graduate
  course on Siegel modular forms, and often asked sensible questions
  in class.

REPLY [3 votes]: Various kinds of modular and automorphic forms arise as partition functions (if I have things straight) in various string theories.  In more mathematical terms, certain generating functions for counting curves on various kind of surfaces or three-folds (probably Calabi--Yau varieties?) are/should be modular forms; but these generating functions have their origins in certain string theory calculations (I think with the given surface/three-fold as background).  
So modular forms are certainly important in string theory.
To give some illustrative names:
Jeff Harvey and Greg Moore are two physicists who have worked/are working on these kinds of ideas.
If you want to learn more about this, you could do worse than google these two authors names.