Prove that any integer divisible by 3 can be written as a sum of cubes of four integers. My book says only this:
$$6k = (k+1)^3 + (k-1)^3 + (-k)^3 + (-k)^3$$
$$6k - 15 = (2k)^3 + (-2k-1)^3 + (k-2)^3 + (-k-2)^3$$
I want to know how it got to these expressions. Using trial and error will take a lot of time.

You can verify them by expanding the cubes on the right side and noting that it comes out right.  Once you do, note that every number divisible by $3$ can be written in one of those two forms, which proves the proposition.  If you want the first one, it is not hard to find.  It is natural to consider $(k+1)^3+(k-1)^3=2k^3+6k$ and then note that you can subtract off two $k^3$s to get there.  Now you have shown that every number divisible by $6$ is the sum of four cubes and it is natural to try to extend the result.
