Try it with your numbers
Show every step
The list is short enough to memorize, but the useful part is why it stops where it does. Once you see that checking divisors up to is enough, you can test any number under in seconds, and the same idea scales to much larger numbers.
What makes a number prime?
A prime is a whole number greater than with exactly two positive factors: and itself. A number with more than two factors is composite. So is prime (factors ) and is composite (factors ). Primes live inside the natural numbers, a branch of the family tree laid out in Classifying Real Numbers, and if you want every factor pair for each number up to , the table of Factors of Numbers 1 to 100 shows them.
If were prime, then and would be different prime factorizations. Excluding keeps every factorization unique.
The number is the only even prime. Every other even number has the factors , and itself, which makes at least three. Primes are also defined only for positive integers in school math, so and negative numbers such as are not called prime.
Quick check
Answer: has one, has two
What are the prime numbers from 1 to 100?
The 25 primes, grouped in quarters so you can see how they thin out:
- to : (9 primes)
- to : (6 primes)
- to : (6 primes)
- to : (4 primes)
The thinning is real. Four of the first ten numbers are prime, but only one of the last ten is, namely . Primes keep getting rarer as numbers grow, yet they never run out: there are 168 primes below 1000, and the list continues forever.
The other numbers from to are composite. The count comes from , where the extra removed is the number itself, which is neither prime nor composite.
How do you find prime numbers up to 100 with a sieve?
The Sieve of Eratosthenes finds primes by elimination. Write the numbers to . Circle , then cross out every larger multiple of . Circle the next uncrossed number, , and cross out its multiples. Repeat with and . Whatever is not crossed out is prime. The Multiples of Numbers 1 to 100 chart gives you the lists to cross out.
Two details make the sieve fast. For each prime , start crossing out at , because smaller multiples such as and were already removed by earlier primes. And stop after , because the next prime, , has , which is past .
| Pass | Cross out multiples of | New numbers removed | Left from 2 to 100 |
|---|---|---|---|
| 1 | (from ) | ||
| 2 | (from ) | ||
| 3 | (from ) | ||
| 4 | (from ) |
The last pass removes only , and . Those three numbers matter, and the fast test below uses them.
Try this: Write the numbers to in a grid and run the sieve with a pencil. After each pass, count what is left and match it to the last column of the table.
Why do you only test primes up to 7 for numbers under 100?
Suppose is composite, so with . Then , which means the smaller factor can never exceed the square root of :
So every composite number has a prime factor no larger than . For that bound is at most , and the only primes up to are . The perfect squares in Perfect Squares List show where the bound changes: and , so is the last prime you need until you reach .
Example: test and .
For : , so test . It is odd. Its digit sum is , so does not divide it. It does not end in or . For , . In notation, (see What a|b Means in Math). So is composite.
For : , so again test . It is odd, its digit sum is , it ends in , and while , so skips over . No prime up to divides it, so is prime.
The bound is a ceiling you must respect. For , , so is on the list, and . Stopping at would call it prime by mistake.
How to tell if a number under 100 is prime fast
Because of the sieve result above, a three-step routine is complete for any number from to :
- If it is even or ends in , it is composite.
- If its digits add to a multiple of , it is composite.
- If it is , or , it is composite. Otherwise it is prime.
The reason is clean. A composite number up to has a prime factor of at most . If , and are ruled out, that factor is , and the cofactor can only be , or , giving exactly , and . Memorize those three impostors and you rarely need a calculator. The full set of tests is in Divisibility Rules.
The trap that costs students points is , and . They look prime because they are odd and end in a “prime-looking” digit, but their digit sums are , and , so each is divisible by : , , .
There is also a filter that cuts the candidates by a third. Every integer is , , , , or . The forms , , are even and is a multiple of . So every prime above has the form .
Example: find the primes from 60 to 80.
Step 1: the numbers of the form in that range are (they sit next to , , and ).
Step 2: and fail.
Step 3: the survivors are . That matches the list above.
The filter is necessary, not sufficient: , , , , , , , and all have the form and are composite.
Quick check
Answer: No,
Patterns hiding in the prime numbers from 1 to 100
Twin primes are pairs that differ by . The twin pairs from 1 to 100 are (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43), (59, 61), (71, 73), eight pairs in all. The pair and overlap, and that is the only triple of primes spaced by , because among any three consecutive odd numbers one is a multiple of .
Last digits are restricted too. Apart from and , every prime ends in , , or , since anything else is even or a multiple of . Below the counts are primes ending in , ending in , ending in and ending in . Add the primes and and the total is .
The numbers through are all composite, so the primes and sit apart. That is the longest prime-free stretch under .
Counting by tens gives the sequence for to , to , and so on. No ten-block has more than four primes, and the sum of all primes is .
How do prime numbers connect to prime factorization?
Every whole number greater than is either prime or a product of primes in exactly one way (ignoring order). That is why primes are called the building blocks of the integers. The skill of splitting a number into those blocks is covered in Prime Factorization, and the list above tells you which blocks to try.
Example: factor and use it.
Step 1: , , , and is prime.
Step 2: so . Likewise .
Step 3: for the Greatest Common Factor, take the lowest power of each shared prime: . For the Least Common Multiple, take the highest power of every prime: .
Step 4: check with . The GCF also simplifies fractions, as in Simplifying Fractions: after dividing top and bottom by .
Quick check
Answer:
Where are prime numbers used in real life?
Online security depends on primes. A common encryption method multiplies two very large primes together and publishes the product. Multiplying is easy, but recovering the two primes from the product takes impractical amounts of computing time when the primes are hundreds of digits long. The small primes in this article follow exactly the same rules as those giant ones.
Nature uses them as well. Some periodical cicadas emerge on cycles of or years, both prime. A prime cycle length rarely lines up with the shorter life cycles of predators, so overlaps are rare.
Primes also decide when things repeat together. Two gears with and teeth share no factor greater than , so every tooth meets every other tooth before the pattern repeats, which spreads wear evenly. That is the same GCF idea from the section above, applied to machines.
One more fact earns a place here: there are infinitely many primes. Euclid’s idea is to multiply any finite list of primes together and add . The result leaves remainder when divided by each prime on the list, so it is either a new prime or has a prime factor you did not list.
How can you check your list of primes up to 100?
Several quick checks catch almost every copying error. First, the count: you should have primes, with in the first ten and in the last ten. Second, the sum should be . Third, there should be no even number except , no number ending in except , and nothing equal to , or (the usual impostors).
When a number falls outside , the same method applies. Find , list the primes up to it, and test each. For example, has , and none of divides it, so is the first prime after . The bound is all you need, whether the number is or a five-digit one.
If your count is off by one, look at the numbers that tempt the eye: , , , and . Each looks prime and is not.
Practice problems
0 of 5 solved
- Is prime? Answer yes or no and give a factor pair if it is not.
Answer: No,
The digits of add to , which is a multiple of . So divides . Dividing gives , so and is composite. - Exactly one of is prime. Which one?
Answer:
: digit sum , so . : digit sum , so . . That leaves , which is odd, has digit sum , does not end in or , and is not , or , so it is prime. - List every pair of twin primes with both primes between and .
Answer:
The primes from to are . Twin primes differ by exactly . Checking neighbors: , , . All other neighboring gaps are or more. - Find the sum of all prime numbers from to .
Answer:
The primes from to are . Add in pairs: , , , , . Then . - Is prime? Remember that is larger than .
Answer: No,
, so primes up to must be tested, not just up to . The primes fail: is odd, its digit sum is , it does not end in or , and leaves remainder . Then , so is composite.
Common questions
How many prime numbers are there from 1 to 100?
There are 25 prime numbers from 1 to 100. The smallest is 2 and the largest is 97.
Is 1 a prime number?
No. A prime must have exactly two positive factors, and 1 has only one. Excluding 1 also keeps prime factorization unique.
Why is 2 the only even prime number?
Every even number greater than 2 is divisible by 2, so it has at least three factors: 1, 2 and itself. The number 2 has only two factors, 1 and 2, so it qualifies.
What are the prime numbers between 1 and 50?
There are 15: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43 and 47. The next prime after 47 is 53.
How many composite numbers are there from 1 to 100?
There are 74. Of the 100 numbers, 25 are prime and the number 1 is neither prime nor composite, leaving 74 composites.
What is the largest prime number below 100?
It is 97. The numbers 98, 99 and 100 are all composite, and 97 is not divisible by 2, 3, 5 or 7.