hi, i am having trouble with problem 2 of ps1. I keep either getting wrong numbers or nothing. Can someone please help me. Thanks This is what I have so far. import math answer=math.log(2) primecount=0 candidate=1 while primecount<999: candidate=candidate+2 divisor=3 not_prime = False while (divisor

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

hi, i am having trouble with problem 2 of ps1. I keep either getting wrong numbers or nothing. Can someone please help me. Thanks This is what I have so far. import math answer=math.log(2) primecount=0 candidate=1 while primecount<999: candidate=candidate+2 divisor=3 not_prime = False while (divisor

MIT 6.00 Intro Computer Science (OCW)
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

sorry it didn't post the bottom but it ends with primecount= primecount 1 print answer
Were you able to do Problem 1? You only need to make some very minor changes to the solution for problem 1 to get it to solve problem 2. I'd reccomend starting with problem 1 and modifying it to solve problem 2. If you want some tips, copy and paste your problem 1 solution and I or somebody else here may be able to advise you.
this is my solution to problem 1, I would appreciate any help with problem 2. primecount=0 candidate=1 while primecount<999: candidate=candidate+2 divisor=3 not_prime = False while (divisor

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Okay, I see what you've changed between the two. Get rid of the "while primecount<998 and not_prime == False:" at the end. Move "answer= answer + math.log(candidate)" into the last if statement. It should work then.
thanks, got it working

Not the answer you are looking for?

Search for more explanations.

Ask your own question