VERIFIED: Sum of 1 to 1000 = 500500 (via formula n*(n+1)/2)