


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). The next prime, 11, is greater than the square root of 100 (namely, 10). (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. 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. We’ll start with all the numbers from 1 to 100: (Next week, we’ll look at efficient ways to do the latter.)ĭoctor Rick’s suggestion is to check each number individually, using the tests he’ll list I’ll do it to all the numbers in parallel, to save writing, which will lead up to the fast method we’re heading toward. What we’ll be doing here is not the most efficient way, but is intended to help Brooke gain an understanding of primes and divisibility tests, not only for making a list but also for checking if an individual number is a prime. I'll give you some pointers, because it will turn out to be useful every now and then to know the primes under 100. 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). There is no shortcut for this.īut what if you don’t have such a list? That’s where Brooke wants help. The problem itself requires trial and error: You have to look at a list of primes and try to find pairs that add to 100 (perhaps by subtracting each prime from 100 and seeing if the result is on the list). Well some are obvious but if I'm going from 1-100 I need an easy way. I want to know a simpler way than trying to multiply a bunch of numbers together. What is an easy way to determine if a number is prime?Įxample: Write the number 100 as the sum of two prime numbers.įor me it is difficult to determine whether or not a number is prime. We’ll start with this question from 2008: Checking if a Number from 1-100 is Prime

The next question many students have is, how can I make a list of prime numbers (or write a computer program to do so)? We’ll learn about the Sieve of Eratosthenes, and list all the prime numbers up to 1000. We’ve looked at what prime numbers are, and how the concept extends (or doesn’t) to 0, 1, and negative integers.
