Computing input length on a one-tape Turing machine In connection with this question it occurred to me to wonder: what is the time complexity
for a single-tape single-head Turing machine to compute the length of its input? To be specific, let's say that the tape alphabet is $\{0,1,b\}$, the input is a string in $(0+1)^*$ surrounded by blanks, the machine starts at the leftmost input symbol, and it must terminate at the leftmost symbol of a string in $(0+1)^*$ (again surrounded by blanks) that gives the binary representation of the input length. This can also be thought of as the problem of converting a number from unary to binary.

It's easy to solve this on a two-tape machine or two-head machine in linear time (just scan the input with one head while using the other head to repeatedly increment a counter; incrementing is a constant amortized time operation). But the single-head solutions I can come up with are only $O(n\log n)$ (e.g. repeatedly increment a counter and then shift it by one position along the tape). Is there a matching lower bound?

I tried some searches but phrases like "one head" and "input length" are so common as to make it difficult to search the literature for known results on this problem.
It cannot be computed in time $o(n\lg n)$.

Let $M$ be a machine which
given an input string $x$ 
halts with the size of $x$ 
written in binary on the tape.

We can add a simple (zero-space linear-time) DFA to $M$ 
to check if the size of the input is a power of two:
just check that the first bit is 1 and the rest is zero.

Let's assume that $M$ runs time $o(n \lg n)$. 
Then we can decide in time $o(n \lg n)$ that 
the size of input is a power of two.
In other words, the following language is 
decidable in $\mathsf{DTime}(n \lg n)$.
$$L = \{ 0^i \mid \exists k \ i = 2^k\}$$
It follows from $\mathsf{DTime}(o(n \lg n)) = \mathsf{Reg}$ 
that $L$ should be regular.
But it is easy to check that the language is not regular.
So $M$ cannot run in time $o(n \lg n)$.