On 2015-12-08 13:46, Allan Wechsler wrote:
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.
Ouch. You are right -- my rule is wrong, and needs amendment. The central string of "1"'s surrounded by the "middlemost" pair of 0's must all be changed to 0's, too.
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] [1] -- [ [2]Golly link suppressed; ask me why] --
Links: ------ [1] http://cube20.org/ [1] [2] http://golly.sf.net/ [2]
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun [3]
Links: ------ [1] http://cube20.org/ [2] http://golly.sf.net/ [3] https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun