The simplest method is to simply list out all the possible sums:
1+2+997 to 1+499+500
498 sums with 1
2+3+995 to 2+498+500
496 sums with 2
3+4+993 to 3+498+499
495 sums with 3
4+5+991 to 4+497+499
493 sums with 4
.
.
.
329+330+341 to 329+335+336
6 sums with 329
330+331+339 to 330+334+336
4 sums with 330
331+332+337, 331+333+336, 331+334+335
3 sums with 331
332+333+335
1 sum with 332
The sum of the subtotals is 1 + 3 + 4 + 6 + ... + 493 + 495 + 496 + 498 = 82834.
Oskar gives a formula for any integer N here.
Richard goes more in depth with an equivalent formula here. |