← Back to Cookie Club

Prime Numbers

Prime Numbers

🔢⭐

Some numbers are extra special! We call them prime numbers.

The number 2 is special. The number 3 is special too! So are 5 and 7. 🌟

You cannot split them into equal groups. They like to stay whole!

What Is a Prime Number?

A prime number is a number that you cannot split into equal groups. The only way to make it is 1 group of that many things.

Let's Try It!

Take 6 cookies. Can you make 2 rows of 3? Yes! Can you make 3 rows of 2? Yes! So 6 is not prime. It can be split up.

Now take 7 cookies. Can you make equal rows? No matter how you try, you always have one left over. The only way is 1 row of 7. So 7 is a prime number! 🍪

The First Few Primes

Here are the smallest prime numbers: 2, 3, 5, 7, 11, 13. The number 1 is not prime because it is too small to count. The number 2 is the only even prime number. Every other even number can be split into groups of 2!

Why Do They Matter?

Prime numbers are the building blocks of all other numbers. Every number is either prime or can be made by multiplying primes together. Pretty cool! ✨

Building Blocks of Numbers

Think of prime numbers like LEGO bricks. Just like you can build anything from LEGO, you can build any number from prime numbers. A prime number is a whole number greater than 1 that can only be divided evenly by 1 and itself.

For example, 7 is prime. The only way to multiply two whole numbers and get 7 is 1 × 7. But 6 is not prime (we call it composite) because 2 × 3 = 6.

Primes vs. Composites

Every whole number bigger than 1 is either prime or composite:

The number 1 is neither prime nor composite. It is in a class by itself.

The number 2 is the only even prime number. Every other even number can be divided by 2, so none of them can be prime. That makes 2 pretty special!

The Cookie Test

Want to know if a number is prime? Try arranging that many cookies into a rectangle. If the only rectangle you can make is a single row, the number is prime.

There are 25 prime numbers under 100. The largest one is 97. Can you find all 25? Here is a hint: start by crossing out every number divisible by 2 (except 2 itself), then every number divisible by 3, then 5, then 7. The numbers left standing are all prime!

Why Primes Matter

Every composite number can be written as a product of primes. For example, 12 = 2 × 2 × 3. This is called prime factorization, and it works for every number, no matter how big. Primes really are the building blocks of math!

The Atoms of Arithmetic

A prime number is a positive integer greater than 1 whose only positive divisors are 1 and itself. Every other positive integer greater than 1 is composite, meaning it can be expressed as a product of smaller positive integers. The number 1 is neither prime nor composite by convention, a decision that simplifies many theorems.

Why do mathematicians care so much about primes? Because of a result so important it is called the Fundamental Theorem of Arithmetic: every integer greater than 1 can be written as a product of prime numbers in exactly one way (ignoring the order of the factors). For example, 60 = 2 × 2 × 3 × 5, and there is no other combination of primes that multiplies to 60.

Fundamental Theorem of Arithmetic: Every integer greater than 1 is either prime or can be expressed as a unique product of prime factors. This is why primes are called the "atoms" of arithmetic: just as atoms combine to form molecules, primes combine to form all other numbers.

The Sieve of Eratosthenes

Around 240 BCE, the Greek mathematician Eratosthenes invented a clever method for finding all primes up to any given number. Write out the numbers from 2 to your target. Circle 2 (it is prime), then cross out every multiple of 2. Move to the next uncrossed number (3), circle it, and cross out its multiples. Keep going. The circled numbers are all prime.

This works because if a number survives the crossing-out process, it has no prime factors smaller than itself, which means it must be prime. The algorithm is beautifully simple and still used (with modern upgrades) in computer science today.

To check whether a number n is prime, you only need to test divisors up to √n. Why? Because if n = a × b, then one of a or b must be ≤ √n. For example, to check if 101 is prime, you only need to test 2, 3, 5, and 7 (since √101 ≈ 10.05). None of them divide 101, so it is prime.

Twin Primes and Patterns

Some primes come in pairs separated by exactly 2, like (3, 5), (11, 13), (17, 19), and (29, 31). These are called twin primes. Mathematicians believe there are infinitely many twin prime pairs, but nobody has been able to prove it. This is one of the oldest unsolved problems in mathematics.

As numbers get larger, primes become less frequent, but they never stop appearing entirely. There is always another prime, no matter how far you count. Euclid proved this over 2,300 years ago, and his elegant proof is still taught in every number theory class.

Primes in the Real World

Primes are not just abstract math. Every time you buy something online, send a private message, or log into a website, your data is protected by encryption systems built on prime numbers. The basic idea: multiplying two large primes together is easy, but figuring out which two primes were used (given only their product) is extraordinarily hard. This one-way difficulty is the foundation of internet security.

Goldbach's Conjecture: Every even number greater than 2 can be written as the sum of two primes. For example, 28 = 5 + 23. This has been verified for every even number up to 4 × 1018 but has never been proven. It is nearly 300 years old and remains one of the most famous unsolved problems in mathematics.

Infinity of Primes: Euclid's Proof

One of the most beautiful proofs in all of mathematics is Euclid's demonstration that there are infinitely many primes, recorded in his Elements around 300 BCE. The argument is a proof by contradiction:

Euclid's Proof (modernized): Assume there are finitely many primes: p1, p2, ..., pn. Construct the number Q = (p1 × p2 × ... × pn) + 1. Now, Q is not divisible by any prime on our list, because dividing Q by any pi leaves a remainder of 1. So either Q is itself prime (a prime not on our list) or Q has a prime factor not on our list. Either way, our list was incomplete. Contradiction. Therefore, there is no finite list of all primes.

This proof is remarkable for its simplicity and power. It requires no advanced machinery, just the Fundamental Theorem of Arithmetic and logical reasoning. It has inspired countless variations, including Euler's proof using the harmonic series and Furstenberg's topological proof.

The Prime Number Theorem

Although primes become less frequent as numbers get larger, they thin out in a predictable way. The Prime Number Theorem, proved independently by Hadamard and de la Vallée-Poussin in 1896, states:

π(x) ~ x / ln(x)

Here π(x) counts the number of primes less than or equal to x, and ln(x) is the natural logarithm. The "~" symbol means the ratio π(x) / (x/ln(x)) approaches 1 as x grows. In practical terms, among numbers near a million, roughly 1 in every 14 is prime. Among numbers near a billion, roughly 1 in every 21 is prime. Primes thin out, but never vanish.

RSA Cryptography

The RSA algorithm, invented by Rivest, Shamir, and Adleman in 1977, is the backbone of internet security. Its security rests on a simple asymmetry involving primes:

Every HTTPS connection, every digital signature, every encrypted email relies on this asymmetry. If someone discovered an efficient factoring algorithm, the consequences for global security would be immediate and severe.

The Riemann Hypothesis

In 1859, Bernhard Riemann published a groundbreaking paper connecting the distribution of primes to the zeros of a complex function called the Riemann zeta function:

ζ(s) = Σ (1/ns) for n = 1, 2, 3, ...

Riemann conjectured that all "non-trivial" zeros of this function have a real part of exactly 1/2. This conjecture, the Riemann Hypothesis, is one of the seven Millennium Prize Problems, with a $1 million bounty for a proof. It remains unproven after more than 160 years, despite being verified computationally for over 10 trillion zeros. If true, it would give us the most precise possible understanding of how primes are distributed among the integers.

Mersenne Primes and the Largest Known Primes

A Mersenne prime is a prime of the form 2p - 1, where p is also prime. Not every such number is prime (211 - 1 = 2047 = 23 × 89), but those that are tend to be enormous. As of 2024, the largest known prime is 2136,279,841 - 1, a Mersenne prime with over 41 million digits. It was discovered by the Great Internet Mersenne Prime Search (GIMPS), a distributed computing project where volunteers donate processing power to test candidates.

Open questions about primes: Are there infinitely many twin primes? Is every even number greater than 2 the sum of two primes (Goldbach's Conjecture)? Are there infinitely many Mersenne primes? Is the Riemann Hypothesis true? Despite millennia of study, these basic questions about the most fundamental objects in mathematics remain unanswered.

The Most Studied Objects in Mathematics

Prime numbers occupy a singular position in mathematics: they are at once the simplest objects to define and among the most difficult to understand deeply. A prime is a positive integer greater than 1 with no positive divisors other than 1 and itself. From this spare definition flows an extraordinary body of theory touching analysis, algebra, geometry, computation, and cryptography.

The centrality of primes rests on the Fundamental Theorem of Arithmetic, first articulated by Euclid (c. 300 BCE) and rigorously proved by Gauss in Disquisitiones Arithmeticae (1801): every integer greater than 1 factors uniquely into a product of primes. This makes primes the multiplicative atoms of the integers, analogous to chemical elements or basis vectors.

Historical Development

The study of primes is among the oldest branches of mathematics. Key milestones include:

Modern Primality Testing

Determining whether a given number is prime is a question with both theoretical and practical significance. The major algorithms include:

Cryptographic Applications

The computational asymmetry between multiplication and factoring underpins modern public-key cryptography. RSA (Rivest-Shamir-Adleman, 1977) selects two large primes p and q (typically 1024 bits each for a 2048-bit key), computes n = pq and the totient φ(n) = (p-1)(q-1), and derives public and private key pairs. The security assumption is that factoring n into p and q is computationally infeasible. The General Number Field Sieve, the fastest known classical factoring algorithm, runs in time exp(O(n1/3(log n)2/3)), which is sub-exponential but super-polynomial.

Shor's algorithm (1994) threatens this model: a sufficiently powerful quantum computer could factor n in polynomial time, rendering RSA insecure. This has motivated the NIST Post-Quantum Cryptography Standardization project, with lattice-based and code-based systems being developed as replacements. As of 2024, no quantum computer has factored a cryptographically relevant number, but the transition to post-quantum standards is underway.

The Largest Known Primes

The search for large primes has a long history, from Mersenne's 17th-century investigations to modern distributed computing. Mersenne primes, of the form Mp = 2p - 1, dominate the record books because the Lucas-Lehmer test provides an efficient primality test specific to this form. As of October 2024, 52 Mersenne primes are known. The largest, 2136,279,841 - 1, was discovered by Luke Durant using GPU computing through the GIMPS project. It has 41,024,320 decimal digits.

Major Open Problems

Sources

  1. Hardy, G.H. & Wright, E.M. An Introduction to the Theory of Numbers. 6th ed. Oxford University Press (2008).
  2. Riemann, B. "Über die Anzahl der Primzahlen unter einer gegebenen Grösse." Monatsberichte der Berliner Akademie (1859).
  3. Agrawal, M., Kayal, N., & Saxena, N. "PRIMES is in P." Annals of Mathematics 160(2):781-793 (2004).
  4. Rivest, R.L., Shamir, A., & Adleman, L.M. "A Method for Obtaining Digital Signatures and Public-Key Cryptosystems." Communications of the ACM 21(2):120-126 (1978).
  5. Shor, P.W. "Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer." SIAM Journal on Computing 26(5):1484-1509 (1997).
  6. Zhang, Y. "Bounded gaps between primes." Annals of Mathematics 179(3):1121-1174 (2014).
  7. Crandall, R. & Pomerance, C. Prime Numbers: A Computational Perspective. 2nd ed. Springer (2005).
  8. Tao, T. "Every odd number greater than 1 is the sum of at most five primes." Mathematics of Computation 83(286):997-1038 (2014).