Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 6 Online
OpenStudy (anonymous):

How can I write a python program to verify that every odd integer greater than 5 is the sum 3 primes?

OpenStudy (anonymous):

make a generator function that generates primes. use that to get a list of primes less than the number you are checking. make two more copies of the list. use three loops to iterate over each item in each list, checking to see if the sum equals the number you are checking.

OpenStudy (anonymous):

There is a famous conjecture LIKE this one, called the Goldbach conjecture. for b7e6c63 the verification is a lot easier. I used the bwCA method. Source is posted: http://dpaste.com/hold/786905/

OpenStudy (anonymous):

http://dpaste.com/787076/

OpenStudy (anonymous):

bwCa, my code verifies every odd from 1 to x. x is user input. Your code only checks against prime numbers. It is faster your way, but I'm not convinced that if a Goldbach sum exists for a prime p, it somehow gets you off the hook for other, odd numbers say of lesser value. For example 11 has 5+3+3 as Goldbach sum 9 is an odd number less than 11, but it's Goldbach sum is 3+3+3.

OpenStudy (anonymous):

And on another topic, whoever posed the question to b7e6c63 is sly. Notice that 5 does not have a Goldbach sum. The odd numbers which can be written as a sum of three primes start at 7 (since 1 is not considered a prime number, but a unit integer)

OpenStudy (anonymous):

hmm... i did not read the spec carefully enuff

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!