There's a (possibly null) block of 1s between the "middlemost pair" of 0s. When you flip that middlemost pair, zero the block of 1s. Alternative statement: flip the middlemost pair of 0s, and everything in between. --Rich -----Original Message----- From: math-fun [mailto:math-fun-bounces@mailman.xmission.com] On Behalf Of Allan Wechsler Sent: Tuesday, December 08, 2015 2:47 PM To: greenwald@cis.upenn.edu; math-fun Subject: [EXTERNAL] Re: [math-fun] 2015 is palindromic in binary Mike's answer is correct when the middle bit _is_ a 0, or when the current palindrome is all 1's. But 10101 -> 11011 is a transition not accounted for in his rule. On Tue, Dec 8, 2015 at 4:15 PM, Michael Greenwald <greenwald@cis.upenn.edu> wrote:
On 2015-12-08 13:01, Tom Rokicki wrote:
Looks good to me! We now return you to your regularly scheduled WDS/rwg programming.
I think the answer for a general string (other than all 1's) is that the next binary palindrome occurs when the "middlemost" pair of 0's (middle single bit, when the middle bit is 0) flip from 0 to 1. Otherwise, if the binary number is 2^n - 1, then the next palindrome is 2^n+1
On Tue, Dec 8, 2015 at 12:47 PM, Michael Greenwald <mbgreen@seas.upenn.edu> wrote:
On 2015-12-08 12:29, Tom Rokicki wrote:
This would have been more appropriate about 11 months ago.
2015 = 11111011111 in base 2. When's the next time that happens?
Isn't it 2047? (If the last 5 bits were anything other than 11111, the high order bits would have to change, too, and that could take a bunch more years).
--
-- http://cube20.org/ [1] -- [ [2]Golly link suppressed; ask me why] --
Links: ------ [1] http://cube20.org/ [2] http://golly.sf.net/
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun