= Solution
The <floor-half generating function> is
$$
H(x)=\sum_{n\geq1}\left\lfloor\frac n2\right\rfloor x^n
=\frac{x^2}{(1-x)^2(1+x)}.
$$
Summing $u_n-2u_{n-1}=\lfloor n/2\rfloor$ for $n\geq1$ gives
$$
G(x)-1-2xG(x)=H(x),
$$
so
$$
\boxed{
G(x)=\frac{1+\dfrac{x^2}{(1-x)^2(1+x)}}{1-2x}}.
$$
Since
$$
\left\lfloor\frac n2\right\rfloor
=\frac n2-\frac14+\frac14(-1)^n,
$$
a particular solution is
$$
-\frac n2-\frac34+\frac1{12}(-1)^n.
$$
Adding the homogeneous term $C2^n$ and imposing $u_0=1$ gives $C=5/3$. Therefore
$$
\boxed{
u_n=\frac53\,2^n-\frac n2-\frac34+\frac1{12}(-1)^n}.
$$
Back to article page