[seqfan] Re: Binary Complement Sequences

Tim Peters tim.peters at gmail.com
Wed Dec 28 19:05:13 CET 2022


On Wed, Dec 28, 2022 at 11:01 AM Tom Duff <eigenvectors at gmail.com> wrote:
> Term 7961756, when starting from 717657 and term 7961711 when starting from
> 820650 are identical 2890 digit numbers.

I assume you mean 820560 rather than 820650 (digit transposition). If
so, iterating 717657 for 46 steps coincides with 820560's successor.
This bare-bones Python program illustrates that:

        def step(i):
            i *= 3
            i ^= (1 << i.bit_length()) - 1
            return i

        x = 717657
        y = 820560
        for i in range(46):
            x = step(x)
        y = step(y)
        assert x == y
        print(x, y)


which prints

    1732623 173263

Good catch!



More information about the SeqFan mailing list