Binary/hexadecimal palindromes are integers that are palindromic in both binary and hexadecimal. Unlike binary/decimal palindromes, for example, they have a predictable structure. This means they can be generated directly, rather than searched for. So what is their structure?

Certainly they’re made up of the hexadecimal digits that are themselves palindromic in binary: 0, 6, 9, F; for example, F060F_{16} = 11110000011000001111_{2} and 9F9_{16} = 100111111001_{2}. Each of these four hexadecimal digits maps neatly to a 4-digit binary palindrome, so any hexadecimal palindrome made from them is automatically palindromic in binary.

But there are other binary/hexadecimal palindromes, like 525_{16} = 10100100101_{2} and 70207_{16} = 1110000001000000111_{2}, that contain hexadecimal digits that are *not* palindromic in binary. In this case, binary palindromes are produced with *combinations* of hexadecimal digits. It turns out there are a limited number of valid combinations, and that they’re localized — they span only *two* hexadecimal digits.

In this article, I’ll analyze binary/hexadecimal palindromes and describe their structure — a structure due to the relationship of the two bases, binary and hexadecimal.

Continue reading “The Structure of Binary/Hexadecimal Palindromes”