Being good at both of these, I have often been asked about the link, and initially, I thought that it was because of the logical structure of the notation, the technical execution of music, and the mathematical nature of rhythm, harmony and consonance/dissonance.
More recently, I realised that this similarity is of minor significance; more significant is the fact that both maths and music are cerebral activities, requiring inner focus; practising a musical instrument and studying maths are both inner activities, performed alone. Activities in groups also occur, but can only be practised amongst groups with a high degree of technical competence, like a secret code.
Finally, I realised that both are activities which can occupy the mind, away from any external stresses that may be troubling the person; they can provide an escape from a stressful situation, at school for instance.
The differences between Maths and Music remain clear - Music has an emotional resonance, maths does not, although maths does have a pure beauty, which cannot be parallelled in music; music has a strong connection with rhythm, particularly physical rhythm (dance); music has the aspect of timbre which, especially with singing, has a direct emotional significance.