Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Prime Numbers






Integers with Exactly Two Factors

The prime numbers are the building blocks of the integers: every integer greater than 11 is either prime or can be expressed as a product of primes. Unlike every other sequence in this section, the primes obey no algebraic formula — there is no expression that computes the nn-th prime from nn. What is known about their distribution comes from deep results in number theory rather than from explicit pattern recognition.



Definition

Seven piles of tiles: 1, 2, 4, 7, 9, 11 and 12. Which of them can only be laid out as a single row?
Every pile can be laid as one long line. Some can also be arranged as a rectangle with two or more rows; others refuse.
Trying every rectangle settles it: 2, 7 and 11 allow only a single row; 4, 9 and 12 allow more.
tilesrectangle layoutspositive divisorsonly a single row?
11 × 11one tile — a special case
21 × 21, 2yes
41 × 4, 2 × 21, 2, 4no
71 × 71, 7yes
91 × 9, 3 × 31, 3, 9no
111 × 111, 11yes
121 × 12, 2 × 6, 3 × 41, 2, 3, 4, 6, 12no
4, 9 and 12 have extra layouts because they split into smaller factors: 4 = 2 · 2, 9 = 3 · 3, 12 = 3 · 4.
Each extra rectangle is an extra pair of divisors. The single-row piles have exactly two divisors, 11 and the number itself — while 11 is the odd one out, with only one divisor.
The definition
A prime number is an integer greater than 11 whose only positive divisors are 11 and itself; an integer greater than 11 with more divisors is composite.
A prime number is an integer greater than 11 whose only positive divisors are 11 and itself. A composite number is an integer greater than 11 that has at least one positive divisor other than 11 and itself. Every integer greater than 11 is exactly one of these two types.
So 22, 77 and 1111 are prime; 44, 99 and 1212 are composite; and 11 is neither.
The primes form a sequence of their own, with no simple formula for the next one.
The first primes are:
Definition
2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,…2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, \ldots
THEOREM
The number 22 is the only even prime — every other even number is divisible by 22 and therefore composite.
1 is not a prime — and that is a deliberate choice.
The number 11 is neither prime nor composite: it has exactly one positive divisor (itself), while primes are required to have exactly two.
The exclusion of 11 is not arbitrary. If 11 were prime, the fundamental theorem of arithmetic would fail: 1212 could be factored as 22⋅32^2 \cdot 3 or 1⋅22⋅31 \cdot 2^2 \cdot 3 or 15⋅22⋅31^5 \cdot 2^2 \cdot 3, and uniqueness of prime factorization would be lost.
Whether the primes ever run out is answered in infinitude of primes.
The rest of the page covers why there are infinitely many primes, the sieve of Eratosthenes, primality testing, prime factorization, the prime number theorem, and types of primes.

Prime Number Notation

Notation

Prime Number Notation

A letter that promises a prime, subscripts that list primes in two different senses, and a function named like the constant it is not.
Divisibility and gcd⁡\gcd follow divisibility notation and GCD notation; ln⁡n\ln n follows logarithm notation.
pp
p — a prime
The standing letter for a prime: in a statement about pp, only primes are meant. Composite numbers usually get nn or mm.
Cases22 is the only even value pp can take; 11 is never a pp.
Do not confusepp as a probability or a polynomial — outside number theory, the letter promises nothing.
p1,p2,…,pkp_1, p_2, \ldots, p_k
p sub one up to p sub k
Subscripts name primes in order. In Euclid's proof the list is every prime there is, assumed finite: N=p1p2⋯pk+1N = p_1 p_2 \cdots p_k + 1.
CasesIn a factorization n=p1a1p2a2⋯pkakn = p_1^{a_1} p_2^{a_2} \cdots p_k^{a_k} the same letters list only the primes of nn, each with its exponent (section 5).
Do not confuseThe two readings. In a factorization p1p_1 is the smallest prime of nn, not necessarily 22: for 1001=7⋅11⋅131001 = 7 \cdot 11 \cdot 13, p1=7p_1 = 7.
π(n)\pi(n)
pi of n — the number of primes up to n
The prime-counting function: π(10)=4\pi(10) = 4, π(100)=25\pi(100) = 25. The prime number theorem says π(n)≈nln⁡n\pi(n) \approx \frac{n}{\ln n}.
CasesCounts primes less than or equal to nn: π(7)=4\pi(7) = 4 includes 77 itself.
Also writtenπ(x)\pi(x) — with a real input, a step function that jumps by 11 at each prime.
Same glyph elsewhereπ≈3.14159\pi \approx 3.14159, the circle constant — unrelated. The parentheses are the only signal: π(n)\pi(n) is a count, πn\pi n a product.
DownloadPNG2×PDF
Notation · Cheat sheet
Sequence Notation at a Glance
The marks from the notation cards across the sequence pages: how each is read and what it means. Every group links to the full card on its page.
Sequences
ana_n
a sub n
The term in place nn; the subscript is a position.
a1,a2,a3,…a_1, a_2, a_3, \ldots
a one, a two, a three, and so on
The terms listed in order; the dots need a stated rule.
{an}n=1∞\{a_n\}_{n=1}^{\infty}
the sequence a sub n
The whole sequence as one object.
Arithmetic sequences
an+1=an+da_{n+1} = a_n + d
next term is this term plus d
The recurrence; dd is the common difference, a1a_1 the start.
∑k=1nak\textstyle\sum_{k=1}^{n} a_k
sum of a sub k, k from 1 to n
Sigma: the sum SnS_n of the first nn terms.
Geometric sequences
rr
r, the common ratio
The factor from each term to the next: an=a1rn−1a_n = a_1 r^{n-1}.
SnS_n
S sub n
Sum of the first nn terms; nn counts terms.
SS
S, the infinite sum
Equals a1/(1−r)a_1 / (1 - r), only when ∣r∣<1|r| < 1.
GG
G, the geometric mean
G=abG = \sqrt{ab}, the middle value of a,G,ba, G, b.
Fibonacci sequence
FnF_n
F sub n
The nn-th Fibonacci number, counted from F1=F2=1F_1 = F_2 = 1.
ϕ,  ψ\phi, \; \psi
phi and psi
The roots of x2=x+1x^2 = x + 1, about 1.6181.618 and −0.618-0.618.
LnL_n
L sub n
Lucas numbers: the same rule, started at 1,31, 3.
Harmonic sequences
an=1/bna_n = 1/b_n
a sub n is one over b sub n
bnb_n is the arithmetic sequence underneath.
HnH_n
H sub n
The harmonic number 1+12+⋯+1n1 + \frac{1}{2} + \cdots + \frac{1}{n}.
HH
H, the harmonic mean
For two numbers, H=2aba+bH = \frac{2ab}{a + b}.
Triangular numbers
TnT_n
T sub n
The nn-th triangular number, n(n+1)2\frac{n(n+1)}{2}.
Tn=Tn−1+nT_n = T_{n-1} + n
the one before plus a row of n
The recurrence, from T1=1T_1 = 1.
(n+12)\binom{n+1}{2}
n plus one choose two
The same number, counted as pairs.
Square numbers
Sn=n2S_n = n^2
S sub n on this page
The nn-th square: one term, not a sum.
Sn=Sn−1+2n−1S_n = S_{n-1} + 2n - 1
the one before plus the next odd number
The recurrence, from S1=1S_1 = 1.
∑k=1nk2\textstyle\sum_{k=1}^{n} k^2
sum of k squared
Square each term first, then add.
Prime numbersThis page
pp
p, a prime
The letter promises a prime.
p1,…,pkp_1, \ldots, p_k
p sub one to p sub k
A list of primes, or the primes of one number.
π(n)\pi(n)
pi of n
How many primes are at most nn.
Same letter, different job
SnS_nA sum of nn terms on the arithmetic and geometric pages; a single square on the square numbers page.
HnH_n vs HHWith a subscript, a sum of reciprocals; without one, a mean.
π(n)\pi(n) vs π\piA count of primes, not the circle constant.
{an}\{a_n\}An ordered sequence, not a set: terms keep their order and may repeat.
Sequence Notation at a Glance·/algebra/sequencesLearn Math Class

Infinitude of Primes

THEOREM
There are infinitely many prime numbers.

Euclid's proof, over two thousand years old, is one of the most celebrated arguments in all of mathematics.

Assume, for contradiction, that only finitely many primes exist: p1,p2,…,pkp_1, p_2, \ldots, p_k. Form the number:

Infinitude of Primes
N=p1⋅p2⋅p3⋯pk+1N = p_1 \cdot p_2 \cdot p_3 \cdots p_k + 1

Dividing NN by any prime pip_i on the list leaves a remainder of 11, so NN is not divisible by any of the listed primes. Either NN is itself prime (a prime missing from the list) or NN has a prime factor not on the list. In either case, the original list is incomplete.

The argument does not claim that NN is prime — it claims that NN has a prime factor outside the assumed list. For instance, 2⋅3⋅5⋅7⋅11⋅13+1=30031=59⋅5092 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdot 13 + 1 = 30031 = 59 \cdot 509, which is composite, but its factors 5959 and 509509 are primes not in the original set.

No finite collection of primes can account for all of them. New primes always exist beyond any boundary.

The Sieve of Eratosthenes

The sieve of Eratosthenes is a systematic algorithm for finding all primes up to a given limit nn.

Start with a list of integers from 22 to nn. The smallest unmarked number is 22 — it is prime. Cross out every multiple of 22 (i.e., 4,6,8,10,…4, 6, 8, 10, \ldots). The next unmarked number is 33 — it is prime. Cross out every multiple of 33 that has not already been crossed out (9,15,21,…9, 15, 21, \ldots; note 6,12,186, 12, 18 are already gone). Continue: the next unmarked number is 55, cross out its multiples, and so on.

The process stops once the current prime exceeds n\sqrt{n}. Any composite number ≤n\leq n must have a factor ≤n\leq \sqrt{n}, so if it were not already eliminated, one of its factors would have crossed it out in an earlier pass.

Pitfall: Counting 1 as a prime
Starting the list at 11 leaves 11 standing, since it is not a multiple of any prime, and the count up to 3030 comes out as 1111. The list starts at 22 because 11 is not prime: there are 1010 primes up to 3030.

Example
For n=30n = 30: start with 2,3,4,5,…,302, 3, 4, 5, \ldots, 30. After sieving by 22: all even numbers >2> 2 are removed. After 33: 9,15,21,279, 15, 21, 27 are removed. After 55: 2525 is removed. Since 30<6\sqrt{30} < 6, the process ends. The surviving numbers 2,3,5,7,11,13,17,19,23,292, 3, 5, 7, 11, 13, 17, 19, 23, 29 are all primes up to 3030.

To list primes in any range up to 104,729, use the prime numbers calculator.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
The sieve after the sweep of 7

The numbers up to 100 after the multiples of 2, 3, 5 and 7 have been crossed out. The sweep of 7 removes only 49, 77 and 91, because every smaller multiple of 7 was already gone. No further sweep is needed: 11 × 11 = 121 is beyond 100, so every number still standing is prime. Step through the sweeps one prime at a time on the sieve of Eratosthenes tool.

Sieving up to n only needs the primes up to √n.

Primality Testing

To determine whether a single integer nn is prime, the most direct method is trial division: test whether nn is divisible by any integer from 22 to ⌊n⌋\lfloor \sqrt{n} \rfloor.

The bound n\sqrt{n} is sufficient because if n=abn = ab with a≤ba \leq b, then a≤na \leq \sqrt{n}. Any factor at or below the square root will be caught; any factor above it has a complementary factor below it.

Efficiency improves by skipping even numbers after checking 22: if nn is not divisible by 22, it cannot be divisible by 4,6,8,…4, 6, 8, \ldots. Checking only 22 and odd numbers up to n\sqrt{n} cuts the work roughly in half. Further savings come from checking only 2,32, 3, and numbers of the form 6k±16k \pm 1, since every prime greater than 33 has this form.

Example
Is 9797 prime? 97<10\sqrt{97} < 10, so check divisibility by 2,3,5,72, 3, 5, 7. None divide 9797, so it is prime.

Example
Is 9191 prime? Check 22 (no), 33 (no), 55 (no), 77: 91=7×1391 = 7 \times 13. It is composite.

Pitfall: Stopping the trial division too early
Testing only 2,3,5,72, 3, 5, 7 and calling 143143 prime stops short of 143≈11.96\sqrt{143} \approx 11.96. Testing 1111 as well gives 143=11⋅13143 = 11 \cdot 13, composite.

Both checks end at the same place: the largest prime that does not exceed n\sqrt{n}. For 9191 and for 9797 that prime is 77, because the next prime, 1111, already has 112=121>9711^2 = 121 > 97.

Trial division works well for numbers up to several digits. For very large numbers — the kind used in cryptography — more advanced methods exist, but they are beyond the scope of this page.
Factor pairsfactors of 91 — found by testing 1 to √91 ≈ 9.541 · 91 = 917 · 13 = 9117139191 = 7 · 13√91 ≈ 9.5test 2, 3, 5, 7 only:7 divides, so 91 is compositeits partner 13 sits above √91
Why trial division stops at √n

The section’s 91 with its divisors paired off: 1 with 91 and 7 with 13. In every pair one partner is at most √91 ≈ 9.5 and the other at least, so testing 2, 3, 5 and 7 is enough to meet every pair from its small end. 7 divides 91, which settles it: composite. For 97 the tests 2, 3, 5, 7 all fail, so the only pair is 1 · 97 and 97 is prime.

For a perfect square such as 49 the pair 7 · 7 sits exactly at √n.
Factors come in pairs on either side of n\sqrt{n}, so a number with no prime factor up to n\sqrt{n} is prime.

Prime Factorization

The fundamental theorem of arithmetic states that every integer greater than 11 can be expressed as a product of prime numbers, and this factorization is unique up to the order of the factors.

Prime Factorization
60=22⋅3⋅5,360=23⋅32⋅5,1001=7⋅11⋅1360 = 2^2 \cdot 3 \cdot 5, \quad 360 = 2^3 \cdot 3^2 \cdot 5, \quad 1001 = 7 \cdot 11 \cdot 13

No matter how the factorization is carried out — whether starting by dividing out 22s or by noticing that 1001=7×1431001 = 7 \times 143 — the final set of prime factors and their multiplicities is always the same.

Finding the factorization uses repeated division by the smallest available prime. Divide nn by 22 as many times as possible, then by 33, then by 55, and so on.

Example
For 252252: 252÷2=126252 \div 2 = 126, 126÷2=63126 \div 2 = 63, 63÷3=2163 \div 3 = 21, 21÷3=721 \div 3 = 7, and 77 is prime. So 252=22⋅32⋅7252 = 2^2 \cdot 3^2 \cdot 7.

Prime factorization connects directly to the GCD and LCM.

RULE
Given the factorizations of two numbers, the GCD takes the minimum power of each shared prime, and the LCM takes the maximum power of each prime that appears in either factorization.

Pitfall: Using the larger powers for the GCD
Taking the larger exponents of the shared primes gives gcd⁡(60,252)=22⋅32=36\gcd(60, 252) = 2^2 \cdot 3^2 = 36, which does not even divide 6060. The GCD takes the smaller ones, 22⋅3=122^2 \cdot 3 = 12; the larger powers of all primes give the LCM, 12601260.

With two factorizations side by side, the work is a comparison prime by prime: write each prime with its exponent in both numbers, using 00 where a prime is missing, and keep one exponent per prime. For 60=22⋅3⋅560 = 2^2 \cdot 3 \cdot 5 and 252=22⋅32⋅7252 = 2^2 \cdot 3^2 \cdot 7 the exponent pairs are (2,2)(2, 2) for 22, (1,2)(1, 2) for 33, (1,0)(1, 0) for 55 and (0,1)(0, 1) for 77.
Prime factorization — 252 Prime factorization — 252 252 2 126 2 63 3 21 3 7 252 = 22 · 32 · 7 252 = 2² · 3² · 7every branch ends in a primeany splitting order givesthe same leaves
The factor tree of 252

The section’s repeated division drawn as a tree: 252 splits off a 2 to leave 126, then another 2 to leave 63, then a 3 to leave 21, which is 3 · 7. Every branch ends in a prime leaf, and the leaves read 2, 2, 3, 3, 7, so 252 = 2² · 3² · 7. Starting with 252 = 4 · 63 or 12 · 21 would grow a different tree with the same leaves.

Uniqueness is why 1 is not prime: a leaf 1 could be added any number of times.

The Prime Number Theorem

Although primes are infinite, they become rarer among larger integers. Among the first 100100 integers, 2525 are prime. Among the first 1,0001{,}000, only 168168. Among the first 1,000,0001{,}000{,}000, only 78,49878{,}498.

The prime number theorem makes this thinning precise. Let π(n)\pi(n) denote the number of primes less than or equal to nn. Then:

Prime Number Theorem
π(n)≈nln⁡n\pi(n) \approx \frac{n}{\ln n}
Learn more about this formula: Prime Number Theorem →


as nn grows large. The approximation improves in relative terms: the ratio π(n)n/ln⁡n\frac{\pi(n)}{n / \ln n} approaches 11.

Fact: A hundred composites in a row
The numbers 101!+2,101!+3,…,101!+101101! + 2, 101! + 3, \ldots, 101! + 101 are 100100 consecutive composites, because kk divides 101!+k101! + k for every kk from 22 to 101101. The same trick gives a prime-free run of any length.

The practical interpretation is that near a large number nn, roughly one in every ln⁡n\ln n integers is prime. Near n=1,000,000n = 1{,}000{,}000, the average gap between consecutive primes is about ln⁡(106)≈13.8\ln(10^6) \approx 13.8. Near n=1012n = 10^{12}, it is about 27.627.6. Primes spread further apart on average but never disappear.

The prime number theorem was conjectured by Gauss and Legendre in the late 18th century and proved independently by Hadamard and de la Vallée-Poussin in 1896.
pi(n), the number of primes up to n, against n / ln n for n up to 100ny10203040506070809010051015202530n / ln nπ(100) = 25blue steps: π(n) climbs by 1 at each primen / ln n ≈ 21.7 at n = 100: the estimateThe prime count π(n) rises ever more slowly, close to n / ln n
Counting primes up to 100

The blue steps are π(n): the count goes up by 1 at each prime 2, 3, 5, 7, …, 97 and reaches 25 at n = 100. The dashed curve is the estimate n / ln n, which gives about 21.7 there. The steps get longer as n grows because primes spread out; the curve follows that bend, and the ratio of the two tends to 1 as n grows without bound.

Below 100 the estimate runs low by about 3; in relative terms the gap shrinks as n grows.
Primes never run out, but they thin out at a steady rate: near nn, about one integer in ln⁡n\ln n is prime.

Types of Primes

Certain primes satisfy additional structural constraints, leading to named families.

Mersenne primes have the form 2p−12^p - 1, where pp itself must be prime (though not every prime pp produces a Mersenne prime). The first Mersenne primes are 3,7,31,1273, 7, 31, 127 (corresponding to p=2,3,5,7p = 2, 3, 5, 7). The exponent p=11p = 11 gives 211−1=2047=23×892^{11} - 1 = 2047 = 23 \times 89, which is composite. The largest known primes are typically Mersenne primes, found by specialized search algorithms.

Fact: Why a 17-gon can be drawn
A regular polygon with a prime number pp of sides can be drawn with ruler and compass exactly when p−1p - 1 is a power of 22, that is, when pp is a Fermat prime. So the 1717-gon, found by Gauss at 1818, can be drawn, but the 77-gon cannot.

Fermat primes have the form 22n+12^{2^n} + 1. Only five are known: 3,5,17,257,655373, 5, 17, 257, 65537 (for n=0,1,2,3,4n = 0, 1, 2, 3, 4). Fermat conjectured that all numbers of this form are prime; Euler disproved this by showing 225+1=4294967297=641×67004172^{2^5} + 1 = 4294967297 = 641 \times 6700417.

Twin primes are pairs of primes that differ by 22: (3,5)(3, 5), (5,7)(5, 7), (11,13)(11, 13), (17,19)(17, 19), (29,31)(29, 31). Whether infinitely many twin prime pairs exist remains one of the oldest open problems in mathematics — the twin prime conjecture is widely believed true but unproven.

Sophie Germain primes are primes pp for which 2p+12p + 1 is also prime. The first examples are 2,3,5,11,23,29,412, 3, 5, 11, 23, 29, 41. These primes play a role in primality testing algorithms and in the theory of safe primes used in cryptography.
DownloadPNG2×PDF
Before you read
Named families of primes
Some primes follow a pattern special enough to earn a name. Four families come up again and again.
Types of primes4 families
Mersenne2p−12^p - 1, pp prime
Examples3, 7, 31, 127
Notethe largest known primes

211−12^{11} - 1 is composite

Fermat22n+12^{2^n} + 1
Knownonly five: 3 up to 65537

Euler disproved the conjecture

Twinpp, p+2p + 2
Open questionare there infinitely many?
Sophie Germainpp and 2p+12p + 1 prime
Used incryptography (safe primes)
Takeaway
Patterns, not guarantees
A formula that produces primes for small inputs can fail later: 211−12^{11} - 1 is composite, and Euler disproved the Fermat conjecture.
Named families of primes·/algebra/sequences/prime-numbersLearn Math Class

Common Pitfalls

Three mistakes come up again and again with prime numbers. Each one is marked where it happens in the sections above; here each is worked through in full, with the wrong and the right working side by side.
DownloadPNG2×PDF
1Counting 1 as a prime
When primes are listed or counted, 11 is included with them. In the sieve this happens when the list starts at 11 instead of 22: 11 is not a multiple of any prime, so no pass ever crosses it out.
Wrong turn
Error here
Sieve the list 1,2,3,…,301, 2, 3, \ldots, 30 by 22, 33 and 55. The survivors are
1,2,3,5,7,11,13,17,19,23,291, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29
And the count of primes up to 3030 comes out as 1111.
Right path
A prime has exactly two positive divisors, and 11 has only one, so the list starts at 22. The survivors are
2,3,5,7,11,13,17,19,23,292, 3, 5, 7, 11, 13, 17, 19, 23, 29
Which is 1010 primes. In the same way π(100)=25\pi(100) = 25, not 2626.
Why it happensThe short form of the definition, "divisible only by 11 and itself", seems to fit 11, since its only divisor is both 11 and itself. The requirement of two different divisors gets lost.
How to checkCount the divisors. A prime has exactly two; 11 has one. A count can be tested on a small case: π(10)=4\pi(10) = 4, for the primes 2,3,5,72, 3, 5, 7.
2Stopping the trial division too early
Trial division stops at a fixed list of small primes, often 2,3,5,72, 3, 5, 7 from familiar examples, instead of running through every prime up to n\sqrt{n}. A number with no small factor is then declared prime.
Wrong turn
Error here
143143 is odd, its digit sum 88 is not a multiple of 33, it does not end in 00 or 55, and 143=7⋅20+3143 = 7 \cdot 20 + 3. No divisor among 2,3,5,72, 3, 5, 7, so 143143 is called prime.
Right path
143≈11.96\sqrt{143} \approx 11.96, so the primes to test are 2,3,5,7,112, 3, 5, 7, 11. The last one divides:
143=11⋅13143 = 11 \cdot 13
And 143143 is composite.
Why it happensThe examples with 9191 and 9797 end at 77, and that list is easy to reuse without working out the bound again. The same slip appears at a perfect square: for 4949, testing only the primes below 77 misses 7=497 = \sqrt{49}, and 49=7⋅749 = 7 \cdot 7.
How to checkFind the bound first. The last prime to test is the largest prime pp with p2≤np^2 \leq n. For 143143, 112=121≤14311^2 = 121 \leq 143 while 132=169>14313^2 = 169 > 143, so 1111 must be on the list.
3Using the larger powers for the GCD
When the GCD and LCM are read from prime factorizations, the two rules are swapped: the GCD gets the larger power of each shared prime, or the LCM gets the smaller ones.
Start
For 60=22⋅3⋅560 = 2^2 \cdot 3 \cdot 5 and 252=22⋅32⋅7252 = 2^2 \cdot 3^2 \cdot 7,
Wrong turn
Error here
gcd⁡(60,252)=22⋅32=36\gcd(60, 252) = 2^2 \cdot 3^2 = 36
Right path
The GCD takes the smaller exponent of each shared prime, and the LCM takes the larger exponent of every prime that appears in either number.
gcd⁡(60,252)=22⋅3=12,\gcd(60, 252) = 2^2 \cdot 3 = 12,

lcm(60,252)=22⋅32⋅5⋅7=1260\text{lcm}(60, 252) = 2^2 \cdot 3^2 \cdot 5 \cdot 7 = 1260
Why it happensThe word "greatest" in greatest common divisor suggests taking the greatest exponents. But a divisor of both numbers cannot hold more copies of a prime than the number that has the fewest.
How to checkThe GCD must divide both numbers. 60÷3660 \div 36 is not a whole number, while 60÷12=560 \div 12 = 5 and 252÷12=21252 \div 12 = 21. A second check: the GCD times the LCM equals the product of the two numbers, 12⋅1260=15120=60⋅25212 \cdot 1260 = 15120 = 60 \cdot 252.
Common pitfalls with prime numbers·/algebra/sequences/prime-numbersLearn Math Class
Each slip loosens a definition. A prime has exactly two divisors, so 11 is not one; trial division must reach the largest prime whose square does not exceed the number; and the GCD takes the smaller exponent of each shared prime, the LCM the larger. A small test settles each case: count the divisors, square the last prime tested, or check that the GCD divides both numbers.

Prime Numbers FAQ

Is 2p−12^p - 1 prime whenever pp is prime?

+
No, and this is the standard trap with Mersenne numbers. A prime exponent is necessary but not sufficient: p=2,3,5,7p = 2, 3, 5, 7 give the primes 3,7,31,1273, 7, 31, 127, but p=11p = 11 gives 211−1=20472^{11} - 1 = 2047, which factors as 23×8923 \times 89. Mersenne primes still supply the largest primes known, found by dedicated search.Read more →

Was Fermat right that every 22n+12^{2^n} + 1 is prime?

+
No. Fermat conjectured it after checking n=0n = 0 through 44, which give 3,5,17,2573, 5, 17, 257 and 6553765537. Euler then factored the next one: 225+1=4294967297=641×67004172^{2^5} + 1 = 4294967297 = 641 \times 6700417. Those five remain the only Fermat primes anyone has found, so the conjecture failed at the first case beyond hand computation.Read more →

Are there infinitely many twin primes?

+
Nobody knows, and it is one of the oldest open problems in mathematics. Twin primes are pairs differing by 22, such as (11,13)(11, 13) and (29,31)(29, 31), and they keep appearing as far as anyone has searched. That contrasts sharply with primes themselves, where infinitude was proved in antiquity. The twin prime conjecture is widely believed but unproven.Read more →

Is p1p2⋯pk+1p_1 p_2 \cdots p_k + 1 always prime?

+
No, and Euclid's proof never claims it is. The number N=p1p2⋯pk+1N = p_1 p_2 \cdots p_k + 1 leaves remainder 11 on division by each listed prime, so its prime factors lie outside the list, but NN itself can be composite. The primes up to 1313 give 2⋅3⋅5⋅7⋅11⋅13+1=30031=59⋅5092 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdot 13 + 1 = 30031 = 59 \cdot 509. The smaller cases 3,7,31,211,23113, 7, 31, 211, 2311 happen to be prime, which is why the claim looks plausible.Read more →

Is every number of the form 6k±16k \pm 1 prime?

+
No; the rule only runs one way. Every prime greater than 33 has the form 6k±16k \pm 1, because 6k6k, 6k+26k + 2 and 6k+46k + 4 are even and 6k+36k + 3 is a multiple of 33. But many numbers of that form are composite, such as 25=6⋅4+125 = 6 \cdot 4 + 1 and 35=6⋅6−135 = 6 \cdot 6 - 1. The form shortens the list of trial divisors; it does not replace trial division.Read more →

Can gaps between primes be as long as you like?

+
Yes. The numbers 101!+2,101!+3,…,101!+101101! + 2, 101! + 3, \ldots, 101! + 101 are 100100 consecutive composites, because each kk from 22 to 101101 divides both 101!101! and kk, and therefore divides 101!+k101! + k. Replacing 101101 by a larger number gives a longer run. This fits the prime number theorem: near nn the average gap between primes is about ln⁡n\ln n, which grows without bound.Read more →

Why can a regular 17-gon be drawn with ruler and compass but not a 7-gon?

+
Because 1717 is a Fermat prime and 77 is not. A regular polygon with a prime number pp of sides can be constructed with ruler and compass exactly when p−1p - 1 is a power of 22, which makes pp a Fermat prime 22n+12^{2^n} + 1. Here 17−1=16=2417 - 1 = 16 = 2^4, while 7−1=67 - 1 = 6 is not a power of 22. Gauss found the 1717-gon construction at 1818.Read more →