Given integers $a, b, c$ construct a single-tape Turing machine recognizing the language $\{w \in \{0,1\}^{*}: a*\#_{0}w+b*\#_{1}w+c=0\}$ in time $O(n*logn)$, where $n=|w|$. $\#_{x}w$ denotes the number of occurrences of the symbol $x$ in $w$.
Updating counters somewhere on the tape would result in $O(n^2)$ complexity. I suspect extended euclidean algorithm has to be used during construction of this machine.