Geometry is a jack-in-the-box. Things jump out at you from a graph or other image that don’t jump out from raw numbers. But geometry applies to raw numbers too. And to letters. A palindrome is defined geometrically: it’s a number or word that reads the same forwards and backwards:
232, 7143417, 80108, 969
pip, sees, Malayalam
A man, a plan, a canal — Panama!
Satan, oscillate my metallic sonatas!
But how fast can you spot the ever-lengthening palindromes here?
1, 1, 1, 2, 2, 1, 2, 3, 3, 2, 1, 2, 4, 2, 3, 4, 4, 3, 2, 4, 2, 1, 2, 3, 6, 4, 2, 4, 6, 3, 4, 5, 5, 4, 3, 6, 4, 2, 4, 6, 3, 2, 1, 2, 4, 2, 3, 4, 8, 6, 4, 8, 4, 2, 4, 6, 9, 6, 3, 6, 8, 4, 5, 6, 6, 5, 4, 8, 6, 3, 6, 9, 6, 4, 2, 4, 8, 4, 6, 8, 4, 3, 2, 4, 2, 1, 2, 3, 6, 4, 2, 4, 6, 3, 4, 5, 10, 8, 6, 12, 8, 4, 8
As the palindromes get longer, the eye gets lazier:
1
1, 1
1, 1, 1
1, 2, 2, 1
2, 1, 2, 3, 3, 2, 1, 2
3, 2, 1, 2, 4, 2, 3, 4, 4, 3, 2, 4, 2, 1, 2, 3
4, 3, 2, 4, 2, 1, 2, 3, 6, 4, 2, 4, 6, 3, 4, 5, 5, 4, 3, 6, 4, 2, 4, 6, 3, 2, 1, 2, 4, 2, 3, 4
What is that sequence of numbers? It’s sequence A167489 at the Online Encyclopedia of Integer Sequences (OEIS), where it’s defined as the “Product of run lengths in binary representation of n”. That is, you find the lengths of the runs of 1 and 0 in a binary number and multiply the lengths like this:
4 in base 10 = 100 in base 2 → one 1, two 0s -> 1 * 2 = 2
5 in b10 = 101 in b2 → one 1, one 0, one 1 -> 1 * 1 * 1 = 1
6 in b10 = 110 in b2 → two 1s, one 0 -> 2 * 1 = 1
7 = 111 → 3
8 = 1000 → 1 * 3 = 3
9 = 1001 → 1 * 2 * 1 = 2
10 = 1010 → 1 * 1 * 1 * 1 = 1
11 = 1011 → 1 * 1 * 2 = 2
The products are palindromic: 2, 1, 2, 3, 3, 2, 1, 2. But it’s much easier to spot those palindromic products in a graph:
Product of run lengths in binary representation of n = 1..1833, A167489 at the OEIS
(click for larger)
Some marked palindromes in run-length products of binary n (white dots mark the center of the red and purple palindromes)
Because the lines in each row are adjusted to fit the same maximum height, the palindromes that extend over two rows start higher than they end, as it were:
Palindrome for n = 10000000..101111111 in base 2 = 128..383 in base 10
Palindrome for n = 100000000..1011111111 in b2 = 256..767
Palindrome for n = 1000000000..10111111111 in b2 = 512..1535
As you can see, each palindrome starts at a power of two, 2^p, but ends beyond the next power of two, 2^(p+1), so the palindromes overlap:
Overlapping palindromes in the first row
Here’s an animation of the overlapping palindromes (note again that the longer ones start higher than they end):
Overlapping palindromes, n = 1..1833 (animated at ezGif)
When the palindromes are represented individually, they grow like this:
Palindrome for n = 10..101 in base 2 = 2..5 in base 10
Palindrome for n = 100..1011 in b2 = 4..11 in b10
Palindrome for n = 1000..10111 in b2 = 8..23 in b10
Palindrome for n = 10000..101111 in b2 = 16..47
Palindrome for n = 100000..1011111 in b2 = 32..95
Palindrome for n = 1000000..10111111 in b264..191
Palindrome for n = 10000000..101111111 in b2 = 128..383
Palindrome for n = 100000000..1011111111 in b2 = 256..767
And related palindromes occur in other bases. In base 3, where you find the run-lengths of 0, 1 and 2, they’re related to powers of 3 (inter alia):

Palindrome for n = 10..212 in b3 = 3..23 in b10
Palindrome for n = 100..2122 in b3 = 9..71 in b10
And in bases 4 and 5, where you find the run-lengths of 0, 1, 2, 3, (4), they’re related to powers of 4 and 5:
Palindrome for n = 10..323 in b4 = 4..59 in b10
Palindrome for n = 100.. in b4 = 16..3233 in b10
Palindrome for n = 10..434 in b5 = 5..119 in b10
Palindrome for n = 100..4344 in b5 = 25..599 in b10














