All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Different Sums (Posted on 2004-07-22)
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?

 See The Solution Submitted by Brian Smith Rating: 3.2500 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re(2): With a little help from awk | Comment 4 of 17 |
(In reply to re: With a little help from awk by Sing4TheDay)

I don't know how the awk program got the correct answer, but the following Basic program, using the correct inequality, gives the same answer, 82834:

FOR a = 1 TO 1000
FOR b = a + 1 TO 1000
c = 1000 - a - b
IF c > b THEN total = total + 1
NEXT
NEXT
PRINT total

 Posted by Charlie on 2004-07-22 10:45:04

 Search: Search body:
Forums (0)
Random Problem
Site Statistics
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox: