I don't know whether this is coincidence, or a quirk of number theory. If it's the latter it's well beyond me, and I'd be interested in any comments.
I've got a test program which is sending binary messages to a graphical output device, the configuration messages can include a palette.
When I was defining palettes in the test program I decided that rather than entering in lots of numbers I'd allow the user to specify either a linear, logarithmic or antilogarithmic (exponential) transfer function.
The palette can be of various sizes: 2^1, 2^2 ... 2^6. The smallest value in the palette should be 0 and the largest 255, so in the case of 2^1 it's (0, 255) and so on.
Of these, the most demanding palette is the exponential palette of size 2^2, since the ideal is to have the smallest value zero and the next non-zero... getting this right took some experimentation. Assuming that entries indexed i = 0..3 are i^z, I get this for various values of z:
(* 1.0001 249 251 253 255 *)
(* 1.001 198 215 234 255 *)
(* 1.01 20 47 109 255 *)
(* 1.1 0 0 0 255 *)
(* 1.05 0 0 4 255 *)
(* 1.025 0 4 31 255 *)
(* 1.024 1 5 34 255 *)
(* 1.026 0 3 29 255 *)
I'm assuming that the best z for a palette sized 2^2 is also best for larger palettes, and I'm slightly spooked that the digit sequence radix 10 is so familiar.
Is there any rational reason why the best z = (2^10+1)/10^3 or is it a dumb coincidence? :-)
MarkMLl