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?
(In reply to
re: With a little help from awk by Sing4TheDay)
Touché -- but you also have to fix the second for(...), and avoid answers including a 0 ("positive integers")...
BEGIN {
total = 0;
for (A=1; A<=1000; A++)
{ for (B=A+1; B<=1000; B++)
{
C = 1000-A-B;
if (C>B) { total++; }
}
}
print total
}
The new answer is 82834. If I had run the program for 25, I would have noticed that it didn't produce a 40 as an answer...