TITLE: The reciprocal condition of an equality
QUESTION [6 upvotes]: It is well known that 
$$\left(\sum_{k=1}^n k\right)^2 = \sum_{k=1}^n k^3.$$
Now given $n$ integers $a_1,a_2,\ldots,a_n > 0$, is it possible to show that if
$$\left(\sum_{k=1}^n a_k\right)^2 = \sum_{k=1}^n a_k^3,$$
then $\{a_1,\ldots,a_n\} = \{1,\ldots,n\}$?
If it is false, for which $a_1,\ldots,a_n$ does this equality hold?
Thanks for your responses.

REPLY [8 votes]: No, because
$$(2+2)^2=4^2=16=2^3+2^3$$
This is even false for every $n\neq1$ because you can choose $a_k=n$ and get:
$$\left(\sum _{k=1}^n n\right){}^2=n^4=\sum _{k=1}^n n^3$$
Besides it holds for all permutations of $\{1,2,\ldots,n\}$ of course, yet it remains to show that there is no other possibility to choose the $a_k$.
Edit:
For $n=4$ we also have for example
$$(2+2+4+4)^2=2^3+2^3+4^3+4^3$$
$$(1+2+2+4)^2=1^3+2^3+2^3+4^3$$
So this suggests there are more non-trivial tuples that satisfy your equation, I am not sure if there is some closed form for the solution set.