I was trying to understand the accepted answer for How to prove $\sum_{n=0}^{\infty} \frac{n^2}{2^n} = 6$?
$$S= \sum_{n=0}^{\infty} \frac{n^2}{2^n} $$
Let $S$ be the given sum. Then $\displaystyle S = 2S - S = \sum_{n=0}^\infty \frac{2n+1}{2^n}$.
I can't understand how this works.