In this challenge, you will receive an input, convert it to hexadecimal, make a couple changes, and output the result.
Because they are only 16 characters in hexadecimal, your code will need to be as short as possible.
Examples
Examples are separated by a blank line. First line is input, second line shows the steps, third shows the output
234589
234589 -> 3945D -> 39454 -> 9A1E -> 9115 -> 239B -> 2392 -> 958
958
435234
435234 -> 6A422 -> 61422 -> EFEE -> 5655 -> 1617
1617
153
153 -> 99 -> 99 -> 63
1617
Steps
The input will always be a positive integer
In order to generate the output you will follow the following steps:
- Convert the input to hexadecimal
- Replace any letters with their index in the alphabet (e.g.
a -> 1, b -> 2
) - Convert the result back to hexadecimal
- If the result contains any letters, go to step 2. If not, output the result
This is code-golf so shortest code in bytes wins!
749699 -> B7083 -> 27083 -> 69CB -> 6932 -> 1B14 -> 1214 -> 4BE -> 425 -> 1A9 -> 119 -> 77
\$\endgroup\$