Prime Numbers

The fundamental building blocks of mathematics: indivisible, infinite and fascinating

A prime number is a natural number greater than 1 that is divisible only by 1 and itself. This means it cannot be expressed as a product of two smaller natural numbers. For example, 7 is prime because it can only be divided by 1 and 7, while 6 is not because it can be divided by 2 and 3.

Why do prime numbers matter?

Prime numbers are the fundamental building blocks of arithmetic. According to the Fundamental Theorem of Arithmetic, every integer greater than 1 can be uniquely expressed as a product of primes. This property makes them the foundation of all number theory. Moreover, primes have critical applications in modern cryptography: protocols such as RSA rely on the difficulty of factoring large numbers into their prime components. Every time you make an online purchase or send an encrypted message, prime numbers are working to protect your information.

A brief history of prime numbers

The study of primes dates back to ancient Greece. Euclid proved around 300 BC that there are infinitely many prime numbers, one of the most elegant proofs in the history of mathematics. Eratosthenes of Cyrene invented a systematic method known as the Sieve of Eratosthenes to find primes, which remains useful today. In the modern era, mathematicians such as Euler, Gauss and Riemann expanded our understanding of prime distribution. The famous Riemann Hypothesis, posed in 1859, about the distribution of primes remains unproven and is one of the Millennium Prize Problems, carrying a one-million-dollar reward.

How to tell if a number is prime?

To check whether a number n is prime, it suffices to verify that it is not divisible by any number from 2 to the square root of n. This method, known as trial division, is efficient for small numbers. For very large numbers, probabilistic algorithms such as the Miller-Rabin test or the deterministic AKS algorithm are used; the latter proved in 2002 that primality can be verified in polynomial time.

The prime counting function

The function π(x) counts how many primes are less than or equal to x. The Prime Number Theorem states that π(x) approximates x/ln(x) as x grows large. This means primes become increasingly rare as we move along the number line, but they never disappear entirely.

π(10) 4 primos
π(100) 25 primos
π(1,000) 168 primos
π(10,000) 1,229 primos
π(100,000) 9,592 primos
π(1,000,000) 78,498 primos

The largest known primes

The search for giant primes is a global effort. The largest known primes are Mersenne primes, of the form 2p − 1. The GIMPS project (Great Internet Mersenne Prime Search) uses distributed computing to find them. The largest known prime to date has more than 41 million digits. These discoveries, while not immediately practical, drive advances in algorithms and computation.

List of the first 100 prime numbers

Click on any prime to see its full analysis with mathematical properties, conversions and curiosities.

Explore more numbers

Discover all its mathematical secrets, hidden meanings and fascinating properties. Every number has a unique story to tell.

Analyze a Number