= Floor-half generating function
The <ordinary generating function> of the <sequence> $a_n=\lfloor n/2\rfloor$ is
$$
\sum_{n\ge1}\left\lfloor\frac n2\right\rfloor x^n=\frac{x^2}{(1-x)^2(1+x)}.
$$
The <floor function> takes the same value $k$ at $n=2k$ and $n=2k+1$. Grouping those adjacent terms gives
$$
\sum_{n\ge0}\left\lfloor\frac n2\right\rfloor x^n
=(1+x)\sum_{k\ge0}kx^{2k}
=(1+x)\frac{x^2}{(1-x^2)^2},
$$
which simplifies to the displayed expression. The middle identity follows by differentiating the <geometric series>. The calculation is valid as an identity of <formal power series>, or analytically for $|x|<1$.
Expanding begins $x^2+x^3+2x^4+2x^5+3x^6+\cdots$, making the paired values of the <sequence> visible in the coefficients.
Back to article page