Very interesting. 1,2,4 and there you stopped. Lets proceed: how do you plan to buy 2^19? That is 524288R. I am afraid power-of-two decade box cannot be made with 20 x E24 resistors. BTW, anyone wishes to count how many 1% E24 resistors are needed to match 2^19=524288R to within 1%??
Since we are dealing with software here, and can calibrate, there is a very easy way to make a "almost power of two" decade box.
Start with a 1 ohm 1% resistor resistor. This resistor is going to be at minimum 0.99 ohms.
Double it. 1.98 ohms
Look at the E24 range, pick the largest value which will never be above that value. in this case, we're talking a 1.8 ohm resistor, maximum value +1 % of 1.818 ohms.
Now repeat. A 1.8 ohm resisistor has a minimum value of 1.782. Double it you get 3.564. Look at the E24 resistors... you get 3.3 ohms (max value 3.333).
Repeat until you reach 10Mohm....
I'm going to roughly choose the following values, there may be one or two which is not accurately calculated based on above - i.e. I may need to reduce one and the successive value.
1, 1.8, 3.3, 6.2, 12, 22, 43, 82, 160, 300, 560, 1K1, 2K0, 3K9, 7K5, 13K, 24K, 47K, 91K, 180K, 330K, 620K, 1.2M, 2.2M, 4.3M, 8.2M.
Wire them up. Measure each one individually in circuit. You'll get the exact value, calibrated, of each. Let's just assume they're all perfect for the next part.
Let's say you need a 132K245 ohm resistor, you enable the following resistors:
91K, 24K, 13K, 3K9, 300, 43, 1.8. For a total of 132,244.8 Ohms.
So: decade box to just under 16.4M with 26 resistors and relays. Note that because of it being software driven, it doesn't matter the exact resistance values, as long as you have covered the entire range without any holes not able to be 'covered' by the lower value resistors.
I will need to do some math as to how tempco/drift does in relation to this.