There are 40 ways to make sums of three distinct positive integers total 25. (1+2+22 is such a sum, but 1+12+12 and 1+2+3+19 are not.)

How many different ways can three distinct positive integers sum to 1000?

Using a variant of my awk program, I found the answer to this problem for 6, 7, 8... and so on. When you calculate the second differences of the results you find a curious pattern (0,0,0,1,-1,1):

6 1

7 1 0

8 2 1 1

9 3 1 0

10 4 1 0

11 5 1 0

12 7 2 1

13 8 1 -1

14 10 2 1

15 12 2 0

16 14 2 0

17 16 2 0

18 19 3 1

19 21 2 -1

20 24 3 1

21 27 3 0

22 30 3 0

23 33 3 0

24 37 4 1

25 40 3 -1

26 44 4 1

27 48 4 0

28 52 4 0

29 56 4 0

30 61 5 1

31 65 4 -1

32 70 5 1

33 75 5 0

34 80 5 0

35 85 5 0

36 91 6 1

37 96 5 -1

38 102 6 1

39 108 6 0

40 114 6 0

41 120 6 0

42 127 7 1

43 133 6 -1

44 140 7 1

45 147 7 0

46 154 7 0

47 161 7 0

48 169 8 1

49 176 7 -1

50 184 8 1

51 192 8 0

52 200 8 0

53 208 8 0

54 217 9 1

This seems to suggest there is a simple (?) formula... which?