Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

13yrsold Group Title

How do you compute prime numbers

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. kgiax Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    You check to see if the only number that can divide evenly into it are 1 and itself.

    • 2 years ago
  2. dmancine Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    That's the mathematical definition. As far as writing a program, you know that 1 and itself already divide it, so you check to see that each of 2 through itself-1 DON'T divide it. (You can actually stop before itself-1, but don't worry about that until you get your code working correctly.) And just a hint, first write the code to test if a single number is prime, and test it. THEN write the code that finds multiple primes.

    • 2 years ago
  3. kgiax Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    Yeah I was just being a wiseass really. He said "compute" and that could really just be "how do I do it on a calculator". But even if he's asking how do you write a program that does it, the answer is the same: you write code that takes a number and checks to see if it only divides evenly by 1 and itself (though yeah, logically you'd do that in reverse like you said). If he doesn't know how to do that, either he should be more specific so we can answer the question better, or maybe he should just re-read the material/rewatch the lecture. It's way too broad a question, is what I'm nitpicking basically.

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

    Yes, but his name says he's only 13, and I don't remember when I learned about prime numbers, but it's possible he doesn't know. Actually, I didn't read your response as wiseass. I guess I've learned to read things on the web as sincere. Either way, I think he knows what a prime number is now.

    • 2 years ago
    • Attachments:

See more questions >>>

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.