Proof that $E[X^2]$ = $\sum_{n=1}^\infty (2n-1) P(X\ge n)$ X is a random variable with values from $\Bbb N\setminus{0}$
I am trying to show that $E[X^2]$ = $\sum_{n=1}^\infty (2n-1) P(X\ge n)$ iff $E[X^2]$ < $\infty$.
I rewrote $P(X \ge n)$:
$E[X^2]$ = $\sum_{n=1}^\infty (2n-1)\sum_{x=1}^\infty 1_{x \ge n}P(X=x)$
Now I tried to rearrange the sums:
$E[X^2]$ = $\sum_{x=1}^\infty \sum_{n=1}^x (2n-1)P(X=x)$
But I think that I made a mistake. Could you give me some hints?
 A: Just as you did it:
\begin{align}
\sum^\infty_{n=1}(2n-1)P(X\geq n) &=\sum^\infty_{n=1}(2n-1)\Big(\sum^\infty_{j=n}P(X=j)\Big)\\
&=\sum^\infty_{j=1}\sum^j_{n=1}P(X=j)(2n-1)\\
&=\sum^\infty_{j=1}P(X=j)\Big(\sum^j_{n=1}(2n-1)\Big)\\
&=\sum^\infty_{j=1}P(X=j)j^2
\end{align}
The last line follows from $\sum^j_{n=1}(2n-1)=2\frac{j(j+1)}{2}-j$
A: Using a bit more machinery.
First note that
$$
X^2=\sum_{n=1}^\infty(2n-1)I(X\geq n)\tag{0}
$$
with probability one where $I$ is the indicator function. To see that this identity is true note that when $X^2=k^2$ (so $X=k$) for an integer $k\geq 1$ the RHS is
$$
\sum_{n=1}^k(2n-1)=\sum_{n=1}^k [n^2-(n-1)^2]=k^2
$$
as desired.
Take expectations of $(0)$ (use the Monotone Convergence Theorem to justify the interchanging of sums and expectations) to yield that
$$
EX^2=\sum_{n=1}^\infty(2n-1)EI(X\geq n)=\sum_{n=1}^\infty (2n-1)P(X\geq n)
$$
as desired. 
A similar result can be realized from the identity
$$
X=\sum_{n=1}^\infty I(X\geq n)\tag{1}
$$
whence by the MCT
$$
EX=\sum_{n=1}^\infty P(X\geq n)
$$
In general for $m\geq 1$ an integer we have that
$$
X^m=\sum_{n=1}^\infty [n^m-(n-1)^m]I(X\geq n)\tag{2}
$$
whence
$$
EX^m=\sum_{n=1}^\infty [n^m-(n-1)^m]P(X\geq n).
$$
The identities (1) and (2) hold with probability one.
