I was participating in a high-school math olympiad qualification contest and this was one of the problems I didn't manage to solve. The solutions will be posted in a month or so, but I'm very eager to know how I could have solved it so I was wondering if someone could help me :)
The problem:
There are $3n$ coins on a pile, either heads or tails up. In a move you can take the top $1\leq m\leq 3n$ coins, pick them up, flip them and put them back on the main pile. Show that no matter what the pile looked like at first, you can reach all possible orderings of heads or tails in the pile with at most $4n - 1$ moves.
I was thinking of representing the orderings as binary numbers (for e.g. head head head tail = 1 1 1 0), so there are $2 ^ {3n} = 8 ^ n$ possible orderings and thought that the solution will have something to do with logs base $2$ but didn't get much further.