In answering this, here is something I do not usually do: give a detailed answer.
But it may help you to see how we work on problems.
I used a computer algebra system to produce some 15 terms of the example.
From that brief table, we see blocks of three and powers of two.
It then took some time to find a closed form of the sequence.
Here is what I found using the ceiling function: