Turing machine that accepts $L = \{a^{n^2} | n ≥ 1 \}$
Note that $1 + 3 + 5 + \cdots + (2n+1) =(n+1)^2$. The input is in unary on one tape, the other tape is a counter, initially containing a single marker. Both heads start at the left of their tapes. A step consists of;


If both heads are at the right end of their markers, quit; input is a square.
Add two markers to the right of the counter tape.
Return to the start of the counter tape.
Advance both heads as long as the counter tape still has unvisited markers.


All you're doing is computing the sum of odd numbers above until you either match the input tape (accept) or exceed it (fail).