Prime numbers up to 1,000
A prime number is a whole number greater than 1 divisible only by 1 and itself. This reference lists all 168 primes from 2 to 997, each with its index in the sequence, and includes a checker that tests any number you type for primality.
How it works
The checker uses trial division. To decide whether n is prime it tests
divisibility by 2, then by each odd number 3, 5, 7, … up to √n. If any
divides n evenly, n is composite and the smallest such divisor is its
smallest prime factor. If none do, n is prime. Testing only up to the square
root is sufficient: if n = a × b with a ≤ b, then a ≤ √n, so a factor
larger than the root always pairs with a smaller one already checked.
Tips and example
- The only even prime is
2; every other even number is divisible by 2. - A number ending in
0or5(above 5) is divisible by 5, never prime. - There are 168 primes below 1000, 25 of them below 100.
- Twin primes — pairs differing by 2, like
(11, 13)or(17, 19)— appear throughout the list.