Happy new year!
2015 = 11111011111 in binary. That is, 2015 is a binary palindrome containing just a single "0" bit -- and thus happens to look a lot like the Eye of Sauron! What's the next number that has this property?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Define the n th palindrome as a ( 2 n + 1 ) -bit binary number containing all ones except the middle bit. Let the decimal representation of the n th palindrome be given by P ( n ) ; for example, P ( 5 ) = 2 0 1 5 , as given.
The largest number an n -bit string can represent is ( 2 n − 1 ) . Hence, a ( 2 n + 1 ) -bit string of ones represents ( 2 2 n + 1 − 1 ) . Switching the middle one-bit to a zero results in subtracting 2 n , since digits 0 to n − 1 are half of the n ones. Hence,
P ( n ) = ( 2 2 n + 1 − 1 ) − 2 n = 2 n ( 2 n + 1 − 1 ) − 1 .
The next number after P ( 5 ) is P ( 6 ) = ( 2 1 3 − 1 ) − 2 6 = 8 1 2 7 .
1 2 3 4 5 6 |
|
Problem Loading...
Note Loading...
Set Loading...
The next number will be 1 1 1 1 1 1 0 1 1 1 1 1 1 2 = 1 F B F 1 6 = 1 × 1 6 3 + 1 5 × 1 6 2 + 1 1 × 1 6 1 + 1 5 = 8 1 2 7