Can an integer be decomposed as $\sum_{k=1}^{m}k^3$? (and how to find $m$?) I have two questions:


I wonder how to check if an integer $n$ can be represented as:


$$n = \sum_{k=1}^{m}k^3$$


And if it can be decomposed this way, how to find $m$?


I tried to use an integral approximation like this: $k = \sqrt[3]{4x}$, but it is not correct, because I need an accurate (descrete) answer.
Since 
$$\sum\limits_{k=0}^m k^3=\left(\frac{m(m+1)}{2}\right) ^2$$
(you can easily prove this by induction), $n$ necessarily has to be a perfect square $i^2$ because $\frac{m(m+1)}{2}\in\mathbb{N}$. Then we have
$$m(m+1)=2i\Leftrightarrow m^2+m-2i=0.$$
If this equation has a positive integer root $m_1$, then
$$\sum\limits_{k=0}^{m_1} k^3=n.$$
If such a root does not exist, the number $n$ cannot be represented in the desired way.
$n$ must be the square of a triangular number.

I.e. it must be a perfect square, 

$$(\lfloor\sqrt{n}\rfloor)^2=n,$$

and $$(m(m+1))^2=4n,$$

where

$$m=\lfloor\sqrt[4]{4n}\rfloor.$$