Solution (source code)

= Solution

The characteristic polynomial of the <linear recurrence relation> is
$$
r^3-6r^2+12r-8=(r-2)^3.
$$
The repeated-root rule therefore gives
$$
x_n=(A+Bn+Cn^2)2^n.
$$
The condition $x_0=0$ gives $A=0$. The other two conditions give
$$
2(B+C)=4,\qquad
4(2B+4C)=24,
$$
so $B+C=2$ and $B+2C=3$. Thus $B=C=1$, and
$$
\boxed{x_n=n(n+1)2^n}.
$$