Alter the code from the previous question to calculate the sum of the integers from 1 to 1000