I suspect you had TTH
happening with probability $\frac{1}{8}$ and giving $E+3$ flips, where $E$ is the expected value of the required number of flips. This is wrong, because we don't have to restart when we get TTH
.
TTH
leads to TTHT
and TTHH
with equal probability. TTHT
gives length $4$; TTHH
gives length $E+4$.
In summary:
\begin{align}
H: &\frac{1}{2} & (E+1) \\
THT: &\frac{1}{8} & 3 \\
THH: &\frac{1}{8} & (E+3) \\
TTT: &\frac{1}{8} & 3 \\
TTHT: &\frac{1}{16} & 4 \\
TTHH: &\frac{1}{16} & (E+4)
\end{align}
Summing them all up and equating to $E$, and solving for $E$ gives $E = \frac{34}{5}$.