Glam Prestige Journal

Bright entertainment trends with youth appeal.

$\begingroup$

The decimal number 371 equals the hexadecimal number 0x173. The part that is relevant to me is that 371 is simply 173 backwards. Is this the only multiple digit decimal number that converts in this manner?

$\endgroup$ 8

1 Answer

$\begingroup$

Wrote a semi-quick python script to do some conversion and string manipulation for a simple search. Output is shown below:

$ ~/python:python test_hex.py
Enter start value in decimal: 0
Enter ending value in decimal: 1000000
Dec: 0 -- Hex: 0x0 -- Result: True
Dec: 1 -- Hex: 0x1 -- Result: True
Dec: 2 -- Hex: 0x2 -- Result: True
Dec: 3 -- Hex: 0x3 -- Result: True
Dec: 4 -- Hex: 0x4 -- Result: True
Dec: 5 -- Hex: 0x5 -- Result: True
Dec: 6 -- Hex: 0x6 -- Result: True
Dec: 7 -- Hex: 0x7 -- Result: True
Dec: 8 -- Hex: 0x8 -- Result: True
Dec: 9 -- Hex: 0x9 -- Result: True
Dec: 53 -- Hex: 0x35 -- Result: True
Dec: 371 -- Hex: 0x173 -- Result: True
Dec: 5141 -- Hex: 0x1415 -- Result: True
Dec: 99481 -- Hex: 0x18499 -- Result: True
Reached 1000000 - End of script.

Note that 99,481 is just shy of 10% of the total range tested, none others are discovered in the remaining 90%. So to answer your question about multiple digit numbers, it appears there are four existing between the decimal values of 0 and 1,000,000.

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy