TITLE: Function that maps the "pureness" of a rational number?
QUESTION [19 upvotes]: By pureness I mean a number that shows how much the numerator and denominator are small.
E.g. $\frac{1}{1}$ is purest, $\frac{1}{2}$ is less pure (but the same as $\frac{2}{1}$), $\frac{2}{3}$ is less pure than the previous examples, $\frac{53}{41}$ is worse, .... $\pi$ isn't pure at all (as well as e...).

REPLY [3 votes]: I've read that Euler ranked the harmoniousness of musical intervals, and thus the simplicity of rational numbers, in a way consistent with this function:

$f(p) = p-1$, if $p$ is prime
$f(ab) = f(a)+f(b)$
$f(a:b:c:\dots) = f(\mathrm{lcm}(a,b,c,\dots))$

assuming, of course, that the argument is expressed in lowest terms.
Much later: I should mention that I read this in On the Sensations of Tone by Hermann Helmholtz; in Alexander Ellis's translation (1885), it's the last paragraph on page 230.