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

Home > Numbers
Composing Composites (Posted on 2024-06-17) Difficulty: 2 of 5
What is the largest even positive integer that cannot be expressed as the sum of two composite odd numbers?

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer Solution Comment 4 of 4 |
Brian Smith's solution is elegant.

My computer program also found 38
-------------
from itertools import combinations_with_replacement

oddcomps = [2*i+1 for i in range(1,2000) if not isprime(2*i+1)]

winningEvens = []
for c in combinations_with_replacement(oddcomps,2):
    x = sum(c)
    if x not in winningEvens:
        winningEvens.append(x)

mylist = sorted(winningEvens)[::-1]
start = mylist[0]
cannotbe = []
for i in range(start, 0, -2):
    if i not in mylist:
        cannotbe.append(i)
print(cannotbe[0])

  Posted by Larry on 2024-06-18 11:43:54
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 (0)
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