# Number theory underlying Euler's theory of music

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?

$$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$.