Solution (source code)

= Solution
{c}

At an <absorbing state>, the remaining <absorption time> is zero, so $e_0=e_n=0$. Multiplying the <linear recurrence relation> by three gives
$$
e_{k+1}-2e_k+e_{k-1}=-3.
$$
The second <finite difference> of $k^2$ is two. A <particular solution> is therefore $-3k^2/2$, while every solution of the corresponding homogeneous <linear recurrence relation> has the form $A+Bk$. The <boundary conditions> give $A=0$ and $B=3n/2$, hence
$$
\boxed{e_k=\frac32k(n-k),\qquad 0\leq k\leq n.}
$$
This is the <mean absorption time of a lazy symmetric random walk> with holding <probability> $1/3$.