[See also the problems
Tuning and Ratio and
Rarity. The set of three problems on mathematics and music
was devised by Benjamin Wardaugh who used to be a member of the
NRICH team. Benjamin is now doing research into the history of
mathematics and music at Oxford University and his article
Music
and Euclid's Algorithm should help you with this problem.]