Can someone help me to construct a Turing Machine for this function:
$f(n) = \frac{n}{8}$. If $n \mod 8 = 0$, then $f(n)$ is undefined.
So the machine should somehow first prove if the number (which is represented in binary) is divisible by $8$ . That means for numbers like $1000$, $10000$, $11000$ and so on. But I don't know how can I check this.
EDIT:
The result from the division is when we delete the last 3 digits in the binary representation of the number. I think this is not so hard. But I still have a problem with the first part. How can I prove if the number is divisible?