The sum of the numbers from 1 to N is N(N+1)/2.
The sum of the numbers from 1 to 200 is (200)(201)/2 = 100(201) = 20100
The sum of the numbers from 1 to 200 divisible by 5 is the sum of 5, 10, 15, ..., 200. This sum is 5 times the sum of the numbers from 1 to 40: 5(40)(41)/2 = 5(20)(41) = 4100.
Since we want the sum of the numbers to 200 exclusive of those divisible by 5, we want 20100 - 4100 = 16000.
The sum of the numbers from 1 to 200 is (200)(201)/2 = 100(201) = 20100
The sum of the numbers from 1 to 200 divisible by 5 is the sum of 5, 10, 15, ..., 200. This sum is 5 times the sum of the numbers from 1 to 40: 5(40)(41)/2 = 5(20)(41) = 4100.
Since we want the sum of the numbers to 200 exclusive of those divisible by 5, we want 20100 - 4100 = 16000.