I'm using a mixed-base number to represent some data. E.g. $4_6 3_6 2_6 0_3 1_3 2_3$. As you can see the bases for the first and last 3 numbers are 6 and 3 respectively.
In the past, this number had the same base (6), so it was just a matter of converting from base 6 to base 10 and I was guaranteed a unique number in base 10 for a corresponding number in base 6.
I'd like to avoid setting up a hash table where the string 432012
maps to (say) 1342
.
Now, I'm trying to figure out how to do the same for this mixed-base number ; any suggestions?
Would this work?
$4_6 3_6 2_6 0_3 1_3 2_3 = 4 \cdot 6^5 + 3 \cdot 6^4 + 2 \cdot 6^3 + 0 \cdot 3^2 + 1 \cdot 3^1 + 2 \cdot 3^0$