This is a fascinating discussion, and I don't have a simple answer for it. To start off with, every composer works with their own way of doing things, but I can try to give examples of what some people have done.
As people have already mentioned, the concept of frequencies, intervals, and harmony have mathematical structures behind them. Concert A is set at an international standard of 440 Hz (although different orchestras will sometimes use tunings of 441, 442, or even higher tunings like 444 – there's also the issue of historical tunings, as the concept of an international standard of pitch is relatively new in the grand scheme of things). An octave above this is 880 Hz: twice the value. An octave below is 220 Hz. Pitch to note name is a logarithmic relationship.
In equal temperament, the distances between all 12 notes within this octave are equal. However, this is at odds with the idea of tuning according to frequency ratios, or just intonation. A just fifth has a frequency ratio of 3:2. 5:4 would be a just major third. You can hear these relationships if two people sing and the beating, or wobbliness, disappears and the two notes seem to meld together and reinforce each other. There's all kinds of interesting things that come out of this, including different types of temperaments and composers experimenting with a variety of tunings. I'd recommend reading Kyle Gann's book called The Arithmetic of Listening if you want to delve into this further.
Music theory ties into these ideas of tuning in various ways – see the ideas of consonance and dissonance, for instance. More consonant intervals are closer to relationships where the frequency ratios between notes are simpler, broadly speaking. Composers after 1900 have also experimented with mathematical methods of music theory in other ways. I'd recommend reading Alan Forte's book on pitch-class set theory. The general gist of this is that intervals are labelled as numbers 1-11, and pitch classes, aka notes, can also be labelled as corresponding to notes between 0 and 11. This system isn't so useful for common practice music, but it can provide valuable insights when examining music that isn't made up of common practice structures – for instance, you can see if different nonstandard chords are related, what sort of intervals are contained within a chord, and more.
Composers like Milton Babbitt and Xenakis have been mentioned. Both of these people had really interesting and very different ways of dealing with relationships between math and music.