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?



Number theory underlying Euler's theory of music
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](http://www.musikwissenschaft.uni-mainz.de/~ag/q/scale.pdf), by Albert Gräf.


