Year 8: Prime numbers within a range of numbers

This cheat-sheet will help you find prime numbers within a given range.

What is a Prime Number?

A prime number is a whole number greater than 1 that has only two divisors: 1 and itself. For example, 2, 3, 5, 7, 11 are all prime numbers.

Finding Prime Numbers within a Range

  1. Start with the smallest number in your range. Start with the lowest number in the range you're checking.
  2. Check for divisibility by numbers from 2 up to the square root of the number. You only need to check for divisibility by numbers up to the square root of the number. If a number has a divisor larger than its square root, it must also have a divisor smaller than its square root.
  3. If the number is divisible by any number other than 1 and itself, it's not prime. If you find a number that divides evenly into the number, it's not prime.
  4. If the number is not divisible by any number from 2 up to its square root, it is prime.

Example

Let's find prime numbers between 10 and 20.

  • 11: Divisible only by 1 and 11. Prime
  • 12: Divisible by 2, 3, 4, 6. Not prime.
  • 13: Divisible only by 1 and 13. Prime
  • 14: Divisible by 2, 7. Not prime.
  • 15: Divisible by 3, 5. Not prime.
  • 17: Divisible only by 1 and 17. Prime
  • 19: Divisible only by 1 and 19. Prime

Remember to always start checking from the smallest number and only check up to the square root!