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

Home > Just Math
Distinct Values Validation (Posted on 2014-10-16) Difficulty: 3 of 5
Each of x, y and z is a nonnegative integer such that:

(i) x+y+z = 94, and:
(ii) H = 4x+10y+19z

How many distinct values of H is possible?

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Better late than never. Computer solution Comment 8 of 8 |
duplicating Charlie's result
The number of distinct solutions is 465
The smallest is 376
The largest is 1786
ans_list = []
for x in range(0,95):     # (x can be from 0 through 94 inclusive)
    for y in range(0,95):
        if 94-x-y >= 0:
            z = 94-x-y
            H = 4*x+10*y+19*z
            if H not in ans_list:
print('The number of distinct solutions is',len(ans_list))
print('The smallest is',min(ans_list))
print('The largest is',max(ans_list))

  Posted by Larry on 2020-09-10 04:39:16
Please log in:
Remember me:
Sign up! | Forgot password

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

Copyright © 2002 - 2020 by Animus Pactum Consulting. All rights reserved. Privacy Information