TITLE: Number theory underlying Euler's theory of music
QUESTION [12 upvotes]: I've recently been studying Euler's theories on music, and I came across Euler's concept of gradus suavitatis or 'degree of pleasure' of a rational number representing the ratio of two tones. (I found this on http://www.mathematik.com/Piano/)
The formula is $G(p/q)=1+\Sigma e_i (p_i-1)$ where $p,q$ are relatively prime, the $p_i$ are the prime factors of $pq$ and $e_i$ is the multiplicity of $p_i$.
This formula seemed familiar. Is this formula used in number theory, and, if so, what is its mathematical significance?

REPLY [7 votes]: This is not directly an answer to your question (graph theoretic relation, rather than number theoretic), but it's too long for a comment.
Euler's formula is a special case of a disharmonicity function
$$D(x)=\sum_i |e_i| g(p_i)$$
with $g(p_i)>0$ a function of the prime factors $p_i$ of a rational number $x=p_1^{e_1} p_2^{e_2}\cdots $ (each with positive or negative multiplicity $e_i$). Euler's disharmonicity has $g(p_i)=p_i-1$ (and adds unity to the sum over $i$). An alternative disharmonicity, due to Barlow, takes $g(p_i)=(2/p_i)(p_i-1)^2$.
Disharmonicity functions can be used to define the notion of a "harmonic distance" of two rational numbers, and to formulate the problem of the harmonization of a musical scale as a problem in graph theory.
See Musical scale rationalization – a graph-theoretic approach, by Albert Gräf.