Which of the following integers is prime: 187, 287, 387, 487, or 587? I can calculate it by hand, but that would take a long time. Is there an easier way? I noticed the numbers only differ 100 from each other, but can I use that fact? Exactly one of these must be prime.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
187 is obviously a multiple of 11. 287 is obviously a multiple of 7. 387 is obviously a multiple of 3. So you just have to work on 487 and 587.
Also, if a number is not prime, one factor is always less than or equal to the square root of that number
For example, the square root of 487 is a little more than 22. So you need only check the primes below 22 (and you see immediately that 2,3 or 5 doesn't work, so you need only check 5 primes).