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

Home > Numbers
How Many Ways (Posted on 2024-12-16) Difficulty: 3 of 5
How many ways are there to choose integers a, b, and c such that 1 ≤ a < b < c ≤ 2024 and a + b + c = 2027?

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution | Comment 2 of 4 |
Using some analysis to limit the search parameters ...
extremes:
    1,2,2024
    674,676,677
    1,1012,1014
    
a can be from 1 to 674
b can be from 2 to 1012
c can be from 677 to 1014

Program output:   341381

------------------
ct = 0
for a in range(1,675):
    for b in range(a+1, 1013):
        if a+b > 1351:
            continue
        c = 2027 - a - b
        if c <= b:
            continue
        ct += 1

print(ct)

  Posted by Larry on 2024-12-16 19:02:38
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 (5)
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