Square of a sum equals sum of cubes Consider a sequence $(a_n)$ of positive numbers such that
$$(a_1+\cdots+a_n)^2=a_1^3+\cdots +a_n^3,\quad n\ge 1.$$
Prove that $a_n=n$ for all $n\ge 1$.

The question should specify that the sequence is increasing since $\{1,2,4,3,5\}$ is a counterexample.
Let's prove this by induction. The base case of $a_1 = 1$ holds since $a_1^2 = a_1^3$. Now assume that $(a_1,\ldots,a_k) = (1,\ldots,k)$ for some $k$. Then we have that $(1+2+\cdots+k+a_{k+1})^2 = \Bigg(\dfrac{(1+k)k}{2}+a_{k+1}\Bigg)^2$. Also, we have that $1^3+2^3+\cdots+a_{k+1}^3 = \dfrac{(1+k)^2k^2}{4}+a_{k+1}^3$. Then, setting them equal we obtain $\Bigg(\dfrac{(1+k)k}{2}+a_{k+1}\Bigg)^2=\dfrac{(1+k)^2k^2}{4}+a_{k+1}^3 \longrightarrow a_{k+1}(k^2+k)+a_{k+1}^2-a_{k+1}^3 = 0 \longrightarrow a_{k+1}(1+k-a_{k+1})(k+a_{k+1}) = 0$. 
Since the sequence is positive, out of the solutions $a_{k+1} = 0, -k,$ and $k+1$, only $k+1$ works thus finishing the induction.
