|


Checking if a Number from 1-100 is PrimeDate: 09/06/2008 at 16:41:34 From: Brooke Subject: what is an easy way to determine if a number is prime What is an easy way to determine if a number is prime? example: Write the number 100 as the sum of two prime numbers. For me it is difficult to determine whether or not a number is prime. I can but it takes a while. I want to know a simpler way than trying to multiply a bunch of numbers together. Well some are obvious but if I'm going from 1-100 I need an easy way. Date: 09/06/2008 at 19:53:45 From: Doctor Rick Subject: Re: what is an easy way to determine if a number is prime Hi, Brooke. There isn't a really easy way, but you can write your own list of prime numbers less than 100 without much trouble (if you can't look up the list, as in our FAQ). I'll give you some pointers, because it will turn out to be useful every now and then to know the primes under 100. If a number can't be divided by any prime number less than or equal to the square root of the number, then it is prime. (If you don't know this, we can discuss it further!) This is a big help, because it means that we can find all the primes under 100 by checking for divisibility by the primes 2, 3, 5, and 7. The next prime, 11, is greater than the square root of 100 (namely, 10). This immediately rules out all numbers ending in an even digit except 2 (because they are divisible by 2), and all numbers ending in 0 or 5 except 5 itself (because they are divisible by 5). All other primes less than 100 must end in 1, 3, 7, or 9. A number is divisible by 3 if the sum of its digits is divisible by 3. That's easy to check for two-digit numbers. Among the numbers in the 50s, for example, this eliminates 51, 54, and 57. We already knew 54 was out, but now our list is down to 53 and 59. You should know your 7-times table and realize that neither of these numbers is on it, so they are both prime. If you've learned up through 7 times 12, then you don't need to actually do a division until you get past 84. That's not bad! Going through the numbers from 2 through 99 in order, I can construct the list of primes fairly quickly. You'll find that the more you do this, the more you'll start recognizing primes in this range. I mess up once in a while, such as thinking that 91 is prime--so I still have to check my list by doing the division by 7. Most of the work, though, as I said, is pretty quick. - Doctor Rick, The Math Forum http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]


Ask Dr. MathTM
© 1994-2013 The Math Forum
http://mathforum.org/dr.math/