Home › Reference › Math theory › Prime and composite numbers

Prime and composite numbers


Definitions

Natural numbers are divided into three groups: one, prime numbers, and composite numbers.

  • A prime number is a natural number greater than 1 that has exactly two divisors: 1 and itself. For example: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29...
  • A composite number is a natural number greater than 1 that has more than two divisors. For example: 4, 6, 8, 9, 10, 12, 14, 15, 16...

The number 1 is considered neither prime nor composite.

Table of prime numbers

Prime numbers up 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, 97.

There are infinitely many prime numbers. This was proved by Euclid in ancient Greece.

Sieve of Eratosthenes

The sieve of Eratosthenes is an algorithm for finding all prime numbers up to a given number N. Steps:

  • Write out all numbers from 2 to N.
  • The first number (2) is prime. Cross out all multiples of 2 (4, 6, 8, 10…).
  • The next uncrossed number (3) is prime. Cross out all multiples of 3 (6, 9, 12…).
  • Continue until you reach a number whose square is greater than N.
  • All uncrossed numbers are prime.

Prime factorization

Any composite number can be decomposed into prime factors — that is, represented as a product of prime numbers.

For example: 84 = 2 · 2 · 3 · 7 = 2² · 3 · 7; 360 = 2³ · 3² · 5.

Such a decomposition is unique (up to the order of factors) — this is the fundamental theorem of arithmetic.

Properties

  • There are infinitely many prime numbers (Euclid's theorem).
  • The only even prime number is 2. All other prime numbers are odd.
  • Any natural number greater than 1 is either prime or uniquely decomposes into prime factors.
  • There are infinitely many twin primes (pairs of the form (p, p + 2)) — this is an unproven conjecture.

Frequently asked questions

Which number is called prime?

A prime number is a natural number greater than 1 that is divisible only by 1 and itself. For example: 2, 3, 5, 7, 11, 13.

Is 1 a prime number?

No, the number 1 is neither prime nor composite. It has only one divisor — 1. A prime number must have exactly two divisors.

What is the smallest prime number?

The smallest prime number is 2. It is also the only even prime number.

How do you check whether a number is prime?

You need to check whether the number is divisible by any other number besides 1 and itself. It is sufficient to check divisors up to the square root of the number. For example, for the number 97, we check divisors 2, 3, 5, 7 (since √97 ≈ 9.8). None fits, so 97 is prime.

  • Quick facts
  • Tables
  • Formulas
  • Geometry formulas
  • Math theory