Hey guys so I picked up Introduction to the Theory of Computation and started studying finite automata and Turing machines. I was given the following language as an exercise in class, in which I need to build a Turing machine with only one tape and no extra tape space that accepts the following language:
$$\{0^{3^k} 1^p, \text{ where $k > 0$ and $p$ is a multiple of $k$}\}$$
How can one build a single tape Turing machine that accepts this kind of language without using any extra tape space?
I found an example for $\{0^n 1^n\}$ in Introduction to the Theory of Computation but I cannot figure out how to build a machine for the language mentioned above.