A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 4 years ago

Problem set 1, problem 2. Can someone explain a bit more about what problem 2 wants.

  • This Question is Closed
  1. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    They want you to write a program that computes the sum of logarithms of all primes from 2 to some number n. Then print out the sum the number and the ratio of these two quantities. The best place to start is to google both prime numbers and logarithm so you understand the question properly. Then once you understand what a prime and a log is do the problem by hand for a very small number carefully noting how you solve it. Write this out as an algorithm and then translate that algorithm to code.

  2. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    hint you will have to solve what a prime is from problem 1 to do this

  3. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I completed the code for problem 1. Is problem 2 wanting me to add the logs of the primes together, eg: n = 3 sum = log(2) + log(3) + log(5) and then get the ratio by sum / n ? thanks for previously responding.

  4. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    yep you will have to use a loop to iterate up to n. When you run it you should see that the ratio gets closer to 1 as it goes.

  5. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.