I am assuming that when you say the first 400 positive integers, you mean positive non-zero integers. If this assumption is correct, the short short way to do it is to take the first value in the set and the last value in the set and find their sum (400+1 = 401), then multiply that sum times the number of pairs (401 * 200) to get your final result.