# Deciding whether the head of a TM remains in K slots?

I am trying to find the following:$$\text{For a given TM M with initial empty tape is it possible to decide whether there}$$ $$\text{exists a constant K such that the head of M remains within the first K slots?}$$

I thought this was possible if you know $K$, since you could add the current configuration to a separate tape and understand whether the machine is looping or not as there exists finitely many configurations with length $K$. But what if you don't know this number? Is it still possible to find a TM that decides this language or is there a reduction from another undecidable language?

Any help will be appreciated.

Hint: Given a Turing machine $M$, you can construct another Turing machine $M'$ with the following properties:
1. If $M$ halts then $M'$ halts.
2. If $M$ doesn't halt then the head of $M'$ eventually reaches the $K$th square from the right for every $K$.
As you mention, given $K$, your property is decidable. This shows that your problem is $\Sigma_1$-complete.