What is a prime number (a whole number above 1 divisible only by 1 and itself)?
Also called: Prime
In one minute
A prime number is a whole number greater than 1, like 2, 3, 5, 7 or 11, that can be divided evenly only by 1 and by itself.
Unlike numbers that can be made by multiplying smaller ones, such as 4 = 2 × 2 and 6 = 2 × 3 (composite numbers), a prime can’t be split any further by multiplication. Every whole number greater than 1 splits into a product of primes in exactly one way, apart from the order (60 = 2 × 2 × 3 × 5), so primes are the building blocks of whole numbers. 1 is left out of the primes to keep that “exactly one way.”
There are infinitely many primes, and they thin out as numbers grow (25 up to 100, 78,498 up to a million). Multiplying two big primes takes an instant, but finding the two again from the answer is very hard, so primes have also been used in encryption (RSA).
A common mix-up
“1 is a prime too, since only 1 and itself divide it.”
It is true that 1 can be divided evenly only by 1, that is, by itself, and in the past some mathematicians did count 1 as a prime. But today a prime is defined as a whole number greater than 1, and 1 is counted as neither prime nor composite. The reason is to keep prime factorization (splitting a whole number into a product of primes) down to exactly one way. Multiplying by 1 changes nothing, so if 1 were a prime, you could keep adding 1s, as in 6 = 2 × 3 = 1 × 2 × 3 = 1 × 1 × 2 × 3 …, and there would be endlessly many ways to split. You can also say that a prime has exactly two different divisors (numbers that divide it evenly), 1 and itself, while 1 has only one.
Explained in pictures
Free to use in lessons, slides and posts with credit (CC BY 4.0).
Free to use in lessons, slides and posts with credit (CC BY 4.0).
Free to use in lessons, slides and posts with credit (CC BY 4.0).
Free to use in lessons, slides and posts with credit (CC BY 4.0).
You’re free to use these figures in lessons, slides and posts if you credit Naru News (naru.news). CC BY 4.0.
Think of it like this
The atoms that things are made of
Everything around us is made of combinations of tiny particles called atoms. For example, every water molecule is made of two hydrogen atoms and one oxygen atom. What a thing is made of can be described as a combination of atoms.
Among whole numbers, the primes play the part of atoms. However you split 60, you get the same combination: two 2s, one 3 and one 5. Fix the whole number and its combination of primes is fixed; fix the combination and the whole number is fixed too. That is why, when studying whole numbers, people often start by splitting them into primes. For example, the biggest number that divides both 12 and 18 is the part they share, 2 × 3 = 6, as you can see from 12 = 2 × 2 × 3 and 18 = 2 × 3 × 3. Multiplying by 1 changes nothing, so 1 is not counted as one of these atom-like building blocks.
But the analogy breaks down in places. The kinds of atoms fit in a single periodic table, but there are infinitely many primes, and no table can hold them all. Also, atoms are held together by chemical bonds, while primes are only joined by multiplication.
Key points
What does it mean that prime factorization is “only one way”?
Writing a whole number of 2 or more as a product of primes only is called prime factorization. For example, whether you split 60 as 6 × 10 or as 4 × 15, splitting all the way down to primes gives 2 × 2 × 3 × 5. Apart from the order of the factors, every whole number splits in only one way. This is called the “fundamental theorem of arithmetic”. A proposition at the root of it already appears in Euclid’s Elements, from about 300 BC.
As in “A common mix-up” above, keeping this “only one way” is why 1 is not counted as a prime. Multiplying by 1 changes nothing, so if 1 were a prime, you could keep adding 1s endlessly.
How do we know there are infinitely many primes?
Euclid’s Elements, from about 300 BC, has a short proof. In today’s words, it goes like this. Suppose you have a list of some primes. Multiply all the primes on the list and add 1. For example, if the list is 2, 3, 5, 7, 11, 13, you get 2 × 3 × 5 × 7 × 11 × 13 + 1 = 30031.
The product of all the listed primes is divisible by each of them. So 30031, one more than that, leaves 1 when divided by any prime on the list. But every whole number of 2 or more is divisible by some prime (if it is itself prime, by itself). 30031 is 2 or more, so some prime divides it, but no prime on the list does, so that prime must be off the list. Indeed, 30031 is 59 × 509, and neither 59 nor 509 is on the list.
Whatever list you make, the same trick finds a prime that is not on it, so a list of primes can never be complete. In other words, there are infinitely many primes.
A common mix-up is that “multiplying them all and adding 1 always gives a prime”. Sometimes it does, as in 2 × 3 × 5 + 1 = 31, but sometimes it doesn’t, as with 30031. All the proof needs is that the result is divisible by some prime not on the list.
How many primes are there?
There are 25 up to 100, 168 up to 1,000, and 78,498 up to a million. Up to 100, 1 number in 4 is prime, but up to a million it is about 1 in 13. The bigger the numbers, the sparser the primes.
There is a rule of thumb for how sparse they get. As x grows, the ratio between the number of primes up to x and x ÷ log x gets closer and closer to 1. Log x is a very slow number that grows by only about 2.3 each time x gets ten times bigger. Put another way, near x, about 1 in every log x numbers is prime. Near a trillion, for example, it is about 1 in 28.
This is called the prime number theorem. At the end of the eighteenth century, Gauss and Legendre studied how the primes add up and made a guess, and in 1896 Hadamard and de la Vallée Poussin each proved it separately. The proofs used the zeta function that Riemann had studied.
The estimate x ÷ log x is about 72,382 at a million, a little smaller than the true 78,498. Another estimate that Gauss considered, Li(x), is about 78,628, even closer.
Is there a pattern in how the primes are spaced?
Where the next prime turns up is very irregular. There are pairs only 2 apart, like 11 and 13 or 17 and 19 (twin primes), yet the next prime after 113 is 127, and none of the 13 numbers in between is prime.
Stretches with no primes can be made as long as you like. For example, multiply all the numbers from 1 to 7 to get 5040, then add 2, 3, 4, 5, 6 and 7: the six numbers from 5042 to 5047 are divisible by 2, 3, 4, 5, 6 and 7 in turn, so none of them is prime. The same trick gives a prime-free stretch 100 or even 10,000 numbers long. On the other hand, whether there are infinitely many twin primes is still not known (the twin prime conjecture).
Although each position is irregular, counted up, the primes grow just as the prime number theorem estimates. How small the gap from Gauss’s estimate Li(x) stays is what the Riemann Hypothesis asks. If it is true, then, counted up, the primes are spread out as regularly as they possibly could be.
How are primes used in encryption?
RSA, one widely used kind of encryption, uses primes. It was presented in a 1978 paper by Rivest, Shamir and Adleman (the name comes from their initials). The person making the keys secretly picks two big primes, p and q, and publishes their product, n, as part of a key that anyone can use.
Multiplying takes an instant, but finding p and q again from n (factoring it) gets very hard when the numbers are big. The safety of this encryption depends on that difficulty. Under the rules of the US standards agency, NIST, the n used for RSA by the government must be 2048 bits (617 decimal digits) or more.
On the other hand, finding primes a few hundred digits long, the size used in encryption, is not hard, because whether a number is prime can be checked quickly without splitting it. The 1978 paper estimates from the prime number theorem that if you want a 100-digit prime, picking 100-digit odd numbers at random and checking them one by one turns one up after about 115 tries on average.
However, in 1994 Shor showed that a large enough quantum computer could factor quickly. So in 2024 the US standards agency adopted new encryption standards built to stand up to quantum computers, and urged that the switch to them begin as soon as possible.
What is the largest known prime?
As of November 2026, the largest known prime is 2 to the power of 136,279,841, minus 1 (2^136279841 − 1). Written out in ordinary digits, it is 41,024,320 digits long, over 16 million digits longer than the previous record. It was found in October 2024 by Luke Durant, through GIMPS, a project in which people search for primes together over the internet, using thousands of GPUs (chips that are good at graphics calculations) in the cloud, spread across datacenters in 17 countries.
Primes of the form 2^p − 1 are called Mersenne primes (after Marin Mersenne, a French monk of the seventeenth century). With this one, 52 Mersenne primes are known. The largest known prime has almost always been a Mersenne prime, because numbers of this form have a specially fast way to check whether they are prime (the Lucas–Lehmer test).
2^p − 1 can be prime only when p is prime. But even when p is prime, it is not always prime. For example, 2^11 − 1 = 2047 = 23 × 89.
There are infinitely many primes, so there are endlessly many primes bigger than this one. “The largest known prime” means the largest one found so far and confirmed to be prime.
Check yourself
Q11 can be divided evenly only by 1 (itself), yet today’s mathematics does not count 1 as a prime. Why not?
Answer and explanation
Answer: B Because if 1 counted, prime splits would not be unique
Multiplying by 1 changes nothing, so if 1 were a prime, you could add as many 1s as you like, 6 = 2 × 3 = 1 × 2 × 3 = 1 × 1 × 2 × 3 …, and there would no longer be just one way to split into a product of primes. 1 is odd, so counting it would still leave 2 as the only even prime. And Euclid’s proof shows there are infinitely many primes whether or not 1 is counted.
More on this → Key points: What does it mean that prime factorization is “only one way”?
Q2Following Euclid’s proof that there are infinitely many primes, multiplying all the primes on the list 2, 3, 5, 7, 11, 13 and adding 1 gives 30031. Which is true of 30031?
Answer and explanation
Answer: C Only primes not on the list divide it
The product of all the listed primes is divisible by each of them, so 30031, one more than that, leaves 1 when divided by any of them. But 30031 is not prime: it is 59 × 509. Neither 59 nor 509 is on the list. Multiplying them all and adding 1 does not always give a prime, but either way, it reveals a prime that is not on the list.
More on this → Key points: How do we know there are infinitely many primes?
Q3In RSA encryption, the answer from multiplying two big primes is published as part of a key that anyone can see. Why is this system safe?
Answer and explanation
Answer: A Multiplying is quick, but finding the two from the answer is slow
Multiplying two big primes takes an instant, but finding the two again from the answer (factoring it) is very hard when the numbers are big, and the safety depends on that difficulty. Meanwhile, whether a number is prime can be checked quickly without splitting it. So finding primes a few hundred digits long, the size used in encryption, is not hard either.
More on this → Key points: How are primes used in encryption?
Related terms
- Riemann Hypothesis
- Zeta function
- Prime factorization
- Prime number theorem
- RSA encryption
- Mersenne prime
- Twin primes
- Quantum computer
Related explainer videos
Sources and how we checked
- Chris K. Caldwell, “FAQ: Why is the number one not prime?” (PrimePages: the definition of a prime as an integer greater than one whose only positive divisors are one and itself, the reason one is left out [every positive integer greater than one can be written uniquely as a product of primes], a = 1·a = 1·1·a = …, and there having been a time when many defined one to be a prime; read November 21, 2026)
- Chris K. Caldwell and Yeng Xiong, “What is the smallest prime?” (Journal of Integer Sequences 15, 2012; the arXiv abstract: there were times and mathematicians for whom one and three were acceptable answers to “what is the first prime?”, and the paper discusses the last significant mathematicians to list one as prime; read November 21, 2026)
- PrimePages glossary, “Fundamental Theorem of Arithmetic” (every positive integer greater than one can be expressed uniquely as a product of primes, apart from the rearrangement of terms, the example 60 = 2²·3·5, and Euclid’s Elements, Book IX, Proposition 14, about 300 BC; read November 21, 2026)
- Euclid’s Elements, Book IX, Proposition 20 (David E. Joyce’s translation and guide, Clark University: “Prime numbers are more than any assigned multitude of prime numbers”, the proof that adds one to the least number measured by the given primes, which is then either prime or measured by a prime not among them, and Euclid illustrating the general case with three primes; read November 21, 2026)
- PrimePages, “Euclid’s Proof of the Infinitude of Primes (c. 300 BC)” (the proof that a prime dividing P = p1p2…pr + 1 cannot be any of the listed primes, and the warning that “it is a common mistake to think that this proof says the product p1p2…pr+1 is prime”, the proof only using that some prime divides it. The figure’s 2×3×5×7×11×13 + 1 = 30031 = 59 × 509 and 2×3×5 + 1 = 31 were computed for this page; read November 21, 2026)
- PrimePages glossary, “Sieve of Eratosthenes” (the method from about 240 BC, keeping 2 and striking out its multiples, then keeping the next number left, 3, and so on, and that striking out the multiples of all primes up to √n leaves only primes up to n. The 25 primes up to 100 in the figure were computed for this page; read November 21, 2026)
- PrimePages, “How Many Primes Are There?” (the prime number theorem [the number of primes up to x is asymptotic to x/ln x], the density of primes near x being about 1/ln x, Legendre’s 1798 estimate and Gauss’s estimate Li(x), the 1896 proofs by Hadamard and, independently, de la Vallée Poussin using Riemann’s work on the complex zeta function, the prime counts up to 10, 100, 1,000, 10,000, 100,000 and 1,000,000 [4, 25, 168, 1,229, 9,592 and 78,498], and there being (probably) infinitely many twin primes and (definitely) arbitrarily large gaps between primes. The prime counts in the 100-number windows [11, 6 and 4 past ten thousand, a million and a trillion] and the estimate 100 ÷ log x in the figure, x ÷ log x [about 72,382 at a million], Li(1,000,000) [about 78,628], the pairs 11 and 13 and 17 and 19, 127 coming after 113, the run 5042 to 5047 and the 1-in-28 near a trillion were computed for this page; read November 21, 2026)
- PrimePages glossary, “Twin Prime Conjecture” (stated as the conjecture that there are infinitely many twin primes; read November 21, 2026)
- E. Bombieri, “Problems of the Millennium: the Riemann Hypothesis” (the Clay Mathematics Institute’s official problem description; Section II: the distribution of primes first receiving attention with Gauss and Legendre at the end of the eighteenth century, Gauss finding in his early years that π(x) is well approximated by Li(x), the Riemann Hypothesis being equivalent to π(x) = Li(x) + O(√x log x), and its failure creating havoc in the distribution of primes; read November 21, 2026)
- R. L. Rivest, A. Shamir and L. Adleman, “A Method for Obtaining Digital Signatures and Public-Key Cryptosystems” (the RSA paper; abstract: the public n is the product of two large secret primes p and q, and the security rests in part on the difficulty of factoring n; Section V: n = p·q and the enormous difficulty of factoring n; Section VII B: testing random odd 100-digit numbers, about 115 are tried before a prime is found, by the prime number theorem, and the primality test does not work by trying to factor; Section IX A: factoring seems much more difficult than determining whether a number is prime or composite; read November 21, 2026)
- Ronald L. Rivest’s list of publications (MIT: the RSA paper in Communications of the ACM 21, 2 (1978), pp. 120–126; read November 21, 2026)
- NIST SP 800-131A Rev. 2, “Transitioning the Use of Cryptographic Algorithms and Key Lengths” (March 2019: RSA keys built on a modulus n that is the product of two primes p and q, the modulus being 2048 bits or more for Federal Government use, and large-scale quantum computers threatening RSA and others, which may need to be replaced with quantum-resistant counterparts. That a 2048-bit number has 617 decimal digits was computed for this page; read November 21, 2026)
- Peter W. Shor, “Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer” (arXiv; an expanded version of a paper at a conference in November 1994: factoring and discrete logarithms are thought to be hard on a classical computer and have been used as the basis of cryptosystems, and efficient algorithms are given for them on a quantum computer; read November 21, 2026)
- NIST, “NIST Releases First 3 Finalized Post-Quantum Encryption Standards” (August 13, 2024: encryption standards designed to withstand an attack by a quantum computer, and FIPS 203 [ML-KEM, a module-lattice-based scheme]; read November 21, 2026)
- GIMPS, “52nd Known Mersenne Prime Discovered” (announcement of October 21, 2024: 2^136279841 − 1 proved prime on October 12, with 41,024,320 digits, over 16 million digits larger than the previous record, found by Luke Durant using thousands of server GPUs spanning 24 datacenter regions over 17 countries, a Mersenne prime being a prime of the form 2^P − 1, named for the French monk Marin Mersenne, there now being 52 known Mersenne primes, and GIMPS, formed in January 1996, where volunteers download a free program to search; read November 21, 2026)
- GIMPS home page (2^136279841 − 1 shown as the largest known prime, and no larger prime among the news items up to September 4, 2026; viewed November 21, 2026)
- PrimePages, “The Largest Known Primes” (the top entry 2^136279841 − 1 [41,024,320 digits, 2024], and the largest known prime having almost always been a Mersenne prime; viewed November 21, 2026)
- PrimePages, “Mersenne Primes: History, Theorems and Lists” (2^n − 1 being called a Mersenne prime when it is prime, n being prime whenever 2^n − 1 is prime, 2^11 − 1 = 2047 = 23 × 89 not being prime, the Lucas–Lehmer test, and Marin Mersenne [1588–1648] being a French monk; read November 21, 2026)
- NIST Chemistry WebBook, “Water” (the chemical formula of water, H2O; viewed November 21, 2026)
- IUPAC, “Periodic Table of Elements” (the International Union of Pure and Applied Chemistry’s periodic table, latest release dated May 4, 2022, laying out the elements in a single table; viewed November 21, 2026)
AI wrote this page from the sources above, and a different AI checked it against the text of those sources (November 21, 2026). A person with a master’s degree in science and a Japanese high-school science teaching license also read and checked it before publishing. Numbers are as of that date. If anything was hard to follow, you spot a mistake, or there’s a term you’d like explained, please write to [email protected].
Glossary
- AI agent
- AI alignment
- Alignment faking
- Artificial general intelligence (AGI)
- Artificial intelligence (AI)
- Backdoor
- Benchmark
- Chain of thought (CoT)
- Context window
- Data poisoning
- Deep learning
- Deepfake
- Diffusion model
- Embedding
- Emergent misalignment
- Evaluation awareness
- Fine-tuning
- Formal verification
- Generalization
- Generative adversarial network (GAN)
- Generative AI
- Goodhart’s law
- Gradual disempowerment
- Hallucination
- Hyperparameter
- Intelligence explosion
- Interpretability
- Jailbreaking
- Large language model (LLM)
- Latent space
- Machine learning
- Mixture of experts (MoE)
- Neural network
- Neuralese
- Overfitting
- Parameter
- Persona vectors
- Pre-training
- Prompt
- Prompt injection
- Reasoning model
- Recursive language model (RLM)
- Recursive self-improvement (RSI)
- Red teaming
- Reinforcement learning (RL)
- Retrieval-augmented generation (RAG)
- Reward hacking
- Reward model
- Shutdown resistance
- Sleeper agent
- Subliminal learning
- Superintelligence (ASI)
- System prompt
- Technological singularity
- Time horizon
- Token
- Transfer learning
- Transformer
- Accretion disk
- Black hole
- Black hole star
- Cosmic birefringence
- Event horizon
- Event Horizon Telescope (EHT)
- General relativity
- GPS
- Gravitational lensing
- Gravitational singularity
- Gravitational wave
- James Webb Space Telescope (JWST)
- Lagrange point
- Long-period radio transient (LPT)
- Neutron star
- Pulsar
- Quasar
- Sagittarius A*
- Space data center
- Spacetime
- Special relativity
- Speed of light
- Supermassive black hole
- White dwarf
