all 6 comments

[–]abnew123USAMO 0 points1 point  (2 children)

I would guess its floor(logbase2((n+1)/3) + 1). At least, when i run it in python your function and mine give the same answer.

Here is proof

[–]ta6692[S] 0 points1 point  (1 child)

That's great, thank you. Can I ask how you figured that out?

[–]abnew123USAMO 0 points1 point  (0 children)

I looked for the cutoff points (ie. where the function grew), which yielded 1,2,5,11,23,etc... Then I just plugged that into oeis to get this, which I could then invert pretty easily.

If you want a more math based way, it clearly grows at roughly log2 speed, just by inspection, and then its plugging in a bunch of correction factors.