Compute the sum of cubes of all integer from 1 to an given integer