2
Situation
I recently received a challenge in college to do :
From the decimal system
0123456789
, using only the numbers that mirrored can still be read find the thousandth number of this system.Example 8 will be the 5th number, 25 the 17th.
Developing
Numbers accepted : 0125689
0 1 2 5 6 8 9
0 1 2 3 4 5 6
10 11 12 15 16 18 19
7 8 9 10 11 12 13
20 21 22 25 26 28 29
14 15 16 17 18 19 20
My proposal
Create a base 7 numeric system with these "characters".
Problem
It does not follow the same pattern of base conversion, would be more for Roman numerals (a more complex tact).
By adding up 1+2
the result is 5
, 9+5 = 12
Question
How to computationally manage this system, say I want to add 25+18. Or any other example.
Obs
I extrapolated a little bit the challenge, which would just be to do with a loop removing the numbers not allowed, but I think it’s a good study.