The lexicographic sort isn't arbitrary:<p><pre><code> 1 = 2^0 / 1 ~= 2^0
1.28 = 2^7 / 100 ~= 2^7/(2^6.6439) ~= 2^(7 - 6.6439) ~= 2^0.3561
1.6 = 2^4 / 10 ~= 2^4/(2^3.3219) ~= 2^(4 - 3.3219) ~= 2^0.6780
2.00 = 2^1 / 1 ~= 2^1
2.56 = 2^8 / 100 ~= 2^8/(2^6.6439) ~= 2^(8 - 6.6439) ~= 2^1.3561
3.2 = 2^5 / 10 ~= 2^5/(2^3.3219) ~= 2^(5 - 3.3219) ~= 2^1.6780
4.0 = 2^2 / 1 = 2^2
6.4 = 2^6 / 10 ~= 2^6/(2^3.3219) ~= 2^(6 - 3.3219) ~= 2^2.6780
8.0 = 2^3 / 1 = 2^3
</code></pre>
Differences between those powers of two:<p><pre><code> 0.3561
0.3219
0.3220
0.3561
0.3219
</code></pre>
These increments are close to 1/3 which is what you need to divide the musical octave (frequency doubling) into 3 steps:<p><pre><code> 2^(0/3) = 1
2^(1/3) ~= 1.2599
2^(2/3) ~= 1.5784
2^(3/3) = 2
</code></pre>
There is a well-known relationship that when you divide a frequency factor of 10 into 10 steps,
you get approximately three steps per musical octave (frequency doubling). You can see this on any 31 band graphical equalizer. This relies on the "coincidence" seen the other table shown:<p><pre><code> 10^0.0 = 1
10^0.1 ~= 1.2589
10^0.2 ~= 1.5849
10^0.3 = 1.9953
</code></pre>
The geometric decade steps provide a close-to-exact doubling also, every three steps.<p>Right, so where did I get those 6.6439 and 3.3219 numbers? Those are just the approximations of log2(100) and log2(10).<p>At the heart of the "lexicographic coincidence" seems to be the observation that these logarithms have .64 and .32 fractional parts, or about 2/3 and 1/3.<p>So for instance since 100 = 2^(log2(100), we can rewrite 1.28 as 128 / 2^(log2(100) which is 2^7/2^(log2(100)).<p>So then we have powers of two on top and bottom and can subtract them: 2^(7 - log2(100)), which is where we get 7 - 6.6439 = 0.3561.
For all intents and purposes multiplying by 2 and multiplying it by a power of 10 until it's between 1 and 10 is equivalent to the dynamical system called an irrational rotation.<p>This equivalence isn't particularly deep but what is important is that irrational rotations are uniquely ergodic. This means that for all intents and purposes this procedure with <i>any</i> starting point will give a set of points that uniformly cover the unit interval (or in this case 1 to 10, logarithmically).<p>It also helps that 2^10 is a near miss for 10^3.
I think this is a lovely description/derivation:<p><a href="https://twitter.com/icecolbeveridge/status/1498410948117340163" rel="nofollow">https://twitter.com/icecolbeveridge/status/14984109481173401...</a><p><a href="https://www.youtube.com/watch?v=VEPRK3O9K2s" rel="nofollow">https://www.youtube.com/watch?v=VEPRK3O9K2s</a>
2 is roughly 10^(0.3)<p>Suppose that you take powers of 2, and then divide by 10 if it's greater than 10.<p><pre><code> 2^7 ~= (10^(0.3))^7 = 10^2.1 --> 10^(2.1 mod 1) = 10^0.1
2^4 ~= (10^(0.3))^4 = 10^1.2 --> 10^(1.2 mod 1) = 10^0.2
2^1 ~= (10^(0.3))^1 = 10^0.3 --> 10^(0.3 mod 1) = 10^0.3
2^8 ~= (10^(0.3))^8 = 10^2.4 --> 10^(2.4 mod 1) = 10^0.4
...
</code></pre>
where the arrow denotes dividing out as many powers of 10 as you can.<p>It seems surprising that the numbers are in the right order but of course it's not. Doing lexicographic sort and then dividing out powers of 10 is the same as dividing out powers of 10 and then just doing a numeric sort. So the lex sort is a sort of (accidental) legerdemain here.<p>The powers to which you raise 2 are given by the inverses of 1, 2, 3 etc mod 10. In other words you're raising (10^0.3) to a power k, chosen so that the remainder 0.3 * k mod 1 is the multiple of 0.1 that you need.<p><pre><code> 1 / 3 mod 10 = 7
2 / 3 mod 10 = 4
3 / 3 mod 10 = 1
4 / 3 mod 10 = 8
...
</code></pre>
They are also given by multiples of 7 mod 3.
Does this generalize? Like taking 2^0, 2^1, ..., 2^99 -> lexicographical sort -> putting the decimal point, and then comparing to 10^0.00, 10^0.01, ...?