Numbers & Arithmetic

Prime Numbers from 1 to 100

There are 2525 prime numbers from 1 to 100: 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,972, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97.

n=ab, a≤b  ⇒  a≤nn = ab,\ a \le b \;\Rightarrow\; a \le \sqrt{n}

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 77 is enough, you can test any number under 121121 in seconds, and the same idea scales to much larger numbers.

What makes a number prime?

A prime is a whole number greater than 11 with exactly two positive factors: 11 and itself. A number with more than two factors is composite. So 77 is prime (factors 1,71, 7) and 99 is composite (factors 1,3,91, 3, 9). 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 100100, the table of Factors of Numbers 1 to 100 shows them.

Why 1 is left out

If 11 were prime, then 12=22×312 = 2^2 \times 3 and 12=1×22×312 = 1 \times 2^2 \times 3 would be different prime factorizations. Excluding 11 keeps every factorization unique.

The number 22 is the only even prime. Every other even number has the factors 11, 22 and itself, which makes at least three. Primes are also defined only for positive integers in school math, so 00 and negative numbers such as −7-7 are not called prime.

Quick check

How many positive factors does 11 have, and how many does 1313 have?

What are the prime numbers from 1 to 100?

The 25 primes, grouped in quarters so you can see how they thin out:

  • 11 to 2525: 2,3,5,7,11,13,17,19,232, 3, 5, 7, 11, 13, 17, 19, 23 (9 primes)
  • 2626 to 5050: 29,31,37,41,43,4729, 31, 37, 41, 43, 47 (6 primes)
  • 5151 to 7575: 53,59,61,67,71,7353, 59, 61, 67, 71, 73 (6 primes)
  • 7676 to 100100: 79,83,89,9779, 83, 89, 97 (4 primes)

The thinning is real. Four of the first ten numbers are prime, but only one of the last ten is, namely 9797. 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 7474 numbers from 22 to 100100 are composite. The count comes from 100−25−1=74100 - 25 - 1 = 74, where the extra 11 removed is the number 11 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 22 to 100100. Circle 22, then cross out every larger multiple of 22. Circle the next uncrossed number, 33, and cross out its multiples. Repeat with 55 and 77. 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 pp, start crossing out at p2p^2, because smaller multiples such as 2p2p and 3p3p were already removed by earlier primes. And stop after 77, because the next prime, 1111, has 112=12111^2 = 121, which is past 100100.

Pass Cross out multiples of New numbers removed Left from 2 to 100
1 22 (from 44) 4949 5050
2 33 (from 99) 1616 3434
3 55 (from 2525) 66 2828
4 77 (from 4949) 33 2525

The last pass removes only 4949, 7777 and 9191. Those three numbers matter, and the fast test below uses them.

Try this: Write the numbers 11 to 100100 in a 10×1010 \times 10 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 nn is composite, so n=a×bn = a \times b with a≤ba \le b. Then a×a≤a×b=na \times a \le a \times b = n, which means the smaller factor can never exceed the square root of nn:

n=ab, a≤b  ⇒  a≤nn = ab,\ a \le b \;\Rightarrow\; a \le \sqrt{n}

So every composite number has a prime factor no larger than n\sqrt{n}. For n≤100n \le 100 that bound is at most 1010, and the only primes up to 1010 are 2,3,5,72, 3, 5, 7. The perfect squares in Perfect Squares List show where the bound changes: 72=497^2 = 49 and 112=12111^2 = 121, so 77 is the last prime you need until you reach 121121.

Example: test 9191 and 9797.

For 9191: 91≈9.5\sqrt{91} \approx 9.5, so test 2,3,5,72, 3, 5, 7. It is odd. Its digit sum is 9+1=109 + 1 = 10, so 33 does not divide it. It does not end in 00 or 55. For 77, 7×13=917 \times 13 = 91. In notation, 7∣917 \mid 91 (see What a|b Means in Math). So 9191 is composite.

For 9797: 97≈9.85\sqrt{97} \approx 9.85, so again test 2,3,5,72, 3, 5, 7. It is odd, its digit sum is 1616, it ends in 77, and 7×13=917 \times 13 = 91 while 7×14=987 \times 14 = 98, so 77 skips over 9797. No prime up to 99 divides it, so 9797 is prime.

The bound is a ceiling you must respect. For 143143, 143≈11.96\sqrt{143} \approx 11.96, so 1111 is on the list, and 11×13=14311 \times 13 = 143. Stopping at 77 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 88 to 100100:

  1. If it is even or ends in 55, it is composite.
  2. If its digits add to a multiple of 33, it is composite.
  3. If it is 4949, 7777 or 9191, it is composite. Otherwise it is prime.

The reason is clean. A composite number up to 100100 has a prime factor of at most 77. If 22, 33 and 55 are ruled out, that factor is 77, and the cofactor can only be 77, 1111 or 1313, giving exactly 4949, 7777 and 9191. 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 5151, 5757 and 8787. They look prime because they are odd and end in a “prime-looking” digit, but their digit sums are 66, 1212 and 1515, so each is divisible by 33: 51=3×1751 = 3 \times 17, 57=3×1957 = 3 \times 19, 87=3×2987 = 3 \times 29.

There is also a filter that cuts the candidates by a third. Every integer is 6k6k, 6k+16k+1, 6k+26k+2, 6k+36k+3, 6k+46k+4 or 6k+56k+5. The forms 6k6k, 6k+26k+2, 6k+46k+4 are even and 6k+36k+3 is a multiple of 33. So every prime above 33 has the form 6k±16k \pm 1.

Example: find the primes from 60 to 80.

Step 1: the numbers of the form 6k±16k \pm 1 in that range are 61,65,67,71,73,77,7961, 65, 67, 71, 73, 77, 79 (they sit next to 6060, 6666, 7272 and 7878).

Step 2: 65=5×1365 = 5 \times 13 and 77=7×1177 = 7 \times 11 fail.

Step 3: the survivors are 61,67,71,73,7961, 67, 71, 73, 79. That matches the list above.

The filter is necessary, not sufficient: 2525, 3535, 4949, 5555, 6565, 7777, 8585, 9191 and 9595 all have the form 6k±16k \pm 1 and are composite.

Quick check

The number 119119 can be written 6×20−16 \times 20 - 1. Is it prime?

Patterns hiding in the prime numbers from 1 to 100

Twin primes are pairs that differ by 22. 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 (3,5)(3, 5) and (5,7)(5, 7) overlap, and that is the only triple of primes spaced by 22, because among any three consecutive odd numbers one is a multiple of 33.

Last digits are restricted too. Apart from 22 and 55, every prime ends in 11, 33, 77 or 99, since anything else is even or a multiple of 55. Below 100100 the counts are 55 primes ending in 11, 77 ending in 33, 66 ending in 77 and 55 ending in 99. Add the primes 22 and 55 and the total is 5+7+6+5+2=255 + 7 + 6 + 5 + 2 = 25.

The biggest gap below 100

The numbers 9090 through 9696 are all composite, so the primes 8989 and 9797 sit 88 apart. That is the longest prime-free stretch under 100100.

Counting by tens gives the sequence 4,4,2,2,3,2,2,3,2,14, 4, 2, 2, 3, 2, 2, 3, 2, 1 for 11 to 1010, 1111 to 2020, and so on. No ten-block has more than four primes, and the sum of all 2525 primes is 10601060.

How do prime numbers connect to prime factorization?

Every whole number greater than 11 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 8484 and use it.

Step 1: 84÷2=4284 \div 2 = 42, 42÷2=2142 \div 2 = 21, 21÷3=721 \div 3 = 7, and 77 is prime.

Step 2: so 84=22×3×784 = 2^2 \times 3 \times 7. Likewise 90=2×32×590 = 2 \times 3^2 \times 5.

Step 3: for the Greatest Common Factor, take the lowest power of each shared prime: 2×3=62 \times 3 = 6. For the Least Common Multiple, take the highest power of every prime: 22×32×5×7=12602^2 \times 3^2 \times 5 \times 7 = 1260.

Step 4: check with 84×906=75606=1260\dfrac{84 \times 90}{6} = \dfrac{7560}{6} = 1260. The GCF also simplifies fractions, as in Simplifying Fractions: 8490=1415\dfrac{84}{90} = \dfrac{14}{15} after dividing top and bottom by 66.

Quick check

Write 6060 as a product of primes.

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 1313 or 1717 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 1515 and 2222 teeth share no factor greater than 11, 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 11. The result leaves remainder 11 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 2525 primes, with 44 in the first ten and 11 in the last ten. Second, the sum should be 10601060. Third, there should be no even number except 22, no number ending in 55 except 55, and nothing equal to 4949, 7777 or 9191 (the usual impostors).

When a number falls outside 100100, the same method applies. Find n\sqrt{n}, list the primes up to it, and test each. For example, 101101 has 101≈10.05\sqrt{101} \approx 10.05, and none of 2,3,5,72, 3, 5, 7 divides it, so 101101 is the first prime after 9797. The bound is all you need, whether the number is 101101 or a five-digit one.

If your count is off by one, look at the numbers that tempt the eye: 5151, 5757, 8787, 9191 and 9393. Each looks prime and is not.

Practice problems

0 of 5 solved

  1. Is 5151 prime? Answer yes or no and give a factor pair if it is not.

  2. Exactly one of 57,61,87,9157, 61, 87, 91 is prime. Which one?

  3. List every pair of twin primes with both primes between 4040 and 8080.

  4. Find the sum of all prime numbers from 5050 to 100100.

  5. Is 143143 prime? Remember that 143\sqrt{143} is larger than 1111.

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.

Up next