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

Home > Numbers
Different Sums (Posted on 2004-07-22) Difficulty: 3 of 5
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.)
blunt force with c - same ans as first | Comment 10 of 17 |
int main() {
  int sum,a,b,c;
  for (a = 1; a < 999; a++)
    for (b = 1; b < 999; b++)
      for (c = 1; c < 999; c++)
 if (a != b && a != c && b != c)
   if (a + b + c == 1000) sum++;
  sum /= 6; //perm to comb - divide by 3!
  printf("%d\n", sum);
}
  Posted by vectorboy on 2004-07-22 11:18:51
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (10)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information