Solution (source code)

= Solution

Let $g(0)=0$. <First-step analysis> gives
$$
 g(1)=1+\frac12g(2),
$$
$$
 g(2)=1+\frac12g(1)+\frac12g(3),
$$
and, because state $3$ moves to $2$ or remains at $3$ with equal probabilities,
$$
 g(3)=1+\frac12g(2)+\frac12g(3).
$$
The last equation gives $g(3)=2+g(2)$. Substitution into the second gives $g(2)=4+g(1)$, and the first then gives $g(1)=3+g(1)/2$. Hence
$$
\boxed{g(1)=6,\qquad g(2)=10,\qquad g(3)=12}.
$$
These are the <expected hitting times> of the absorbing state.