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

Home > Just Math
Integer Expression Exploration (Posted on 2025-01-07) Difficulty: 3 of 5
How many positive integers cannot be written as 7a + 19b + 28c, where a, b, and c are positive integers (not necessarily distinct)?

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution probable solution | Comment 2 of 3 |
The sum of the factors, i.e. f(1,1,1) is 54, so as the largest value for (a,b,c) grows by one, the largest produced value of the expression grows by 54.

Call the largest value for (a,b,c) "big".
Call the largest value of the expression which can be produced "max".

The number that cannot be produced, grows with increasing "big" up to 168 for big = 6 then decreases and stabilizes at 161 for big >= 7.

So the answer to the posed question is 161, although the specific numbers which cannot appear change as the largest value for (a,b,c) changes.

program output:
big cannot max
1 53 54
2 100 108
3 135 162
4 152 216
5 165 270
6 168 324
7 161 378
8 161 432
9 161 486
10 161 540
11 161 594
12 161 648
13 161 702
14 161 756
15 161 810
16 161 864
17 161 918
18 161 972
19 161 1026
20 161 1080

------------
ans = []

for big in range(1,21):
    ans = []
    for a in range(1,big+1):
        for b in range(1,big+1):
            for c in range(1,big+1):
                x = 7*a + 19*b + 28*c
                if x not in ans:
                    ans.append(x)
    
    top = max(ans)
    ans = sorted(ans)
    mylist = [i for i in range(1,top+1)]
    for a in ans:
        mylist.remove(a)
    
    print(big, len(mylist),  top)

  Posted by Larry on 2025-01-07 12:59:16
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 (18)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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