Formula for "cleanliness" or "roundness" of fraction

58 Views Asked by At

I'm looking for some metric that can score fractions or decimals by how "clean" or "round" they are. Put another way, I want to measure inverse "dissonance". I want to give a high score to numbers like 1, 1/2, 2/3, 1/4, etc., and low scores to 3/13, or $\sqrt{2}$.

One idea I had was to just add the numerator and the denominator of the most simplified form, but I wanted to see if there were other ideas out there. I also looked briefly at entropy in cryptography and data compression.

Huge bonus points if the method could handle numbers close to round fractions. So that for example $2^\frac{7}{12} \approx 3/2$ would get a good score even though it's irrational.

Any thoughts? thanks!