4 min read
2026-02-16
Quickly determining whether a number is prime is a useful skill. These techniques will help.
All even numbers except 2 are composite. This immediately eliminates half of all numbers.
For numbers up to 100, it's enough to check divisibility by 2, 3, 5, and 7. If the number is not divisible by any of them, it's prime.
Only check divisors up to the square root of the number. For the number 97, it's enough to check divisors up to 9 (since 10² = 100 > 97).
There are only 25: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97. Memorize at least the first 15.
All prime numbers except 2 and 3 have the form 6k - 1 or 6k + 1. This means prime numbers are found adjacent to multiples of 6.
Numbers of the form 2^n - 1 are often prime (when n is prime). This is used to search for record-breaking large prime numbers.
Two numbers can be coprime (GCD = 1) even if each of them is composite. For example, 8 and 15 are coprime.
See also: GCD and LCM, Factorials and Combinatorics, Fraction Calculator