<s>[INST] Find a generating function for $\sum_{k=0}^{n} k^2$ 
Find a generating function for $\sum_{k=0}^{n} k^2$

I know my solution is wrong, but why?  
My solution:
If $F(x)$ generates $\sum_{k=0}^{n} k^2$ then $F(x)(1-x)$ generates $k^2$.  
$\frac{x}{(1-x)^4}: \left\{ 0,1,4,9,16,25...  \right\}$
$\frac{x}{(1-x)^3}: \left\{ 0,1,3,5,7,9...  \right\}$
$\frac{x}{(1-x)^2}: \left\{ 0,1,2,2,2,2...  \right\}$
$\frac{x}{1-x}: \left\{ 0,1,1,1,1,1...  \right\}$
$x: \left\{ 0,1,0,0,0,0...  \right\}$  
So, $F(x)=\frac{x}{(1-x)^5}$ generates $\sum_{k=0}^{n} k^2$
 [/INST] The differences of $\{0,1,2,2,2,2,\dots\}$ are $\{0,1,1,0,0,\dotsc\}$, not $\{0,1,1,1,1,\dotsc\}$.
So you should get
$$\begin{align}
x+x^2 &: \{0,1,1,0,0,\dotsc\}\\
\frac{x+x^2}{1-x} &: \{ 0,1,2,2,2,\dotsc\}\\
\frac{x+x^2}{(1-x)^2} &: \{ 0,1,3,5,7,\dotsc\}\\
\frac{x(1+x)}{(1-x)^3} &: \{ 0,1,4,9,\dotsc\}
\end{align}$$
and
$$\frac{x(1+x)}{(1-x)^4}$$
as the generating function of $\sum k^2$.
</s>