Solution (source code)

= Solution
{c}

The homogeneous <characteristic equation of a linear recurrence> is
$$
r^2+2r+1=(r+1)^2=0.
$$
The <repeated characteristic root of a linear recurrence> $-1$ supplies the independent terms $(-1)^n$ and $n(-1)^n$. A constant <particular solution> is $1/2$, since $1/2=-2(1/2)-1/2+2$. Thus $u_n=1/2+(A+Bn)(-1)^n$.

\b[The scan prints $u_2=0$, not $u_1=0$. These <initial conditions> are consistent.] They give $A=1/2$ from $u_0=1$, then $0=1/2+A+2B$, so $B=-1/2$. Therefore
$$
\boxed{u_n=\frac12+\frac{1-n}{2}(-1)^n.}
$$
In particular $u_1=1/2$ and $u_2=0$. Direct substitution verifies the <recurrence relation>. This is an example of <nonconsecutive initial values for a linear recurrence>; replacing the printed subscript by 1 would change the answer.