Calculating $\sum_{k=1}^\infty \frac{k^2}{2^k}=\frac{1}{2}+\frac{4}{4}+\frac{9}{8}+\frac{16}{16}+\frac{25}{32}+\cdots+\frac{k^2}{2^k}+\cdots$ I want to know the value of $$\sum_{k=1}^\infty \frac{k^2}{2^k}=\frac{1}{2}+\frac{4}{4}+\frac{9}{8}+\frac{16}{16}+\frac{25}{32}+\cdots+\frac{k^2}{2^k}+\cdots$$
I added up to $k=50$ and got the value $5.999999999997597$, so it seems that it converges to $6.$ But, I don't know how to get the exact value. Is there any other simple method to calculate it?

Alternatively, note that if $T = \sum_{k \geq 0}k^2 2^{-k}$ then $$T = 2T-T = \sum_{k\geq 0}\frac{2k+1}{2^k} = 2\sum_{k \geq 0}\frac{k}{2^k} + \sum_{k \geq 0}2^{-k} $$
But we can let $S= \sum_{k \geq 0}k2^{-k}$ and note that $$S = 2S-S = \sum_{k\geq 0}2^{-k} = 2.$$
Hence $T = 2\cdot 2 + 2 = 6.$
