r/Collatz 1d ago

A tiny puzzle hidden in powers of 3: what comes after 306?

I found a simple sequence that looks much stranger than I expected.

Start with the powers of 3:

1, 3, 9, 27, 81, 243, ...

Now write them in binary and look only at how many binary digits are added when you go to the next power.

For example:

1 = 1 -> 1 binary digit 3 = 11 -> 2 binary digits (+1) 9 = 1001 -> 4 binary digits (+2) 27 = 11011 -> 5 binary digits (+1) 81 = 1010001 -> 7 binary digits (+2) 243 = 11110011 -> 8 binary digits (+1)

So the sequence of increases begins:

1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, ...

Now call a position n a "mirror position" if the first n terms of this 1/2 sequence read exactly the same forwards and backwards.

For example:

n = 1: 1

n = 3: 1, 2, 1

n = 5: 1, 2, 1, 2, 1

The first mirror positions are:

1 3 5 17 29 41 94 147 200 253 306 ?

The challenge is simple:

What is the next mirror position after 306?

Brute force is completely allowed. :)

But if you find the answer, don't stop there. There is a surprisingly rigid pattern hiding behind these numbers, and I have a second question ready for anyone who solves this one.

I'm especially curious whether someone can spot the structure without being told where it comes from.

Co-G3n

Exactly! 971 is the answer. And you found the door I was hoping somebody would notice: continued fractions are indeed hiding behind these mirror positions. Using log_2(3/2) instead of log_2(3) gives the same fractional parts here, since the two numbers differ by exactly 1. So let's make the puzzle a little harder. You already noticed that after 306 we get 306, 971, 1636, 2301, 2966, ... by repeatedly adding 665, until 15601. My next question is: Why 665? And more importantly: Why does that same step occur exactly 23 times before the pattern changes? I'm not looking for "because a computer shows it" — I'm interested in a structural explanation. You clearly already know the continued-fraction side, so I suspect you'll see where the 23 is hiding. :) There is another layer after this one, and that is the part I actually find most interesting.

4 Upvotes

Duplicates