Topic · Arithmetic

Factors, Multiples & Primes

Multiplication has a hidden structure: some numbers can be broken down into smaller pieces, and some can't. The ones that can't — the primes — are the atoms of arithmetic, and every other whole number is built by multiplying primes together in exactly one way. That fact is so central it gets its own name: the Fundamental Theorem of Arithmetic.

What you'll leave with

  • The dual relationship between factors and multiples — $6$ is a factor of $24$ is the same fact as $24$ is a multiple of $6$.
  • Quick divisibility tests for the small divisors, and why each one works.
  • Why prime numbers are the "atoms" — and why $1$ is excluded by convention.
  • The Fundamental Theorem of Arithmetic: every whole number bigger than $1$ has exactly one prime factorization.
  • How GCD and LCM fall out of the factorizations for free.

1. Factors and multiples

Two words for the same relationship, viewed from different sides.

Factor

A whole number $a$ is a factor (or divisor) of a whole number $b$ if $b \div a$ leaves no remainder. Equivalently, $b = a \cdot k$ for some whole number $k$.

Multiple

A whole number $b$ is a multiple of $a$ if $b = a \cdot k$ for some whole number $k$. The list of multiples of $a$ is $a, 2a, 3a, 4a, \ldots$ — every number on $a$'s "times table."

These are the same statement read two ways. "$6$ is a factor of $24$" and "$24$ is a multiple of $6$" describe the identical fact: $24 = 6 \cdot 4$. Pick whichever phrasing feels natural for the situation.

A few clean facts to keep in your head:

  • $1$ is a factor of every whole number. (Take $k = b$ in $b = 1 \cdot k$.)
  • Every whole number is a factor of itself. (Take $k = 1$.)
  • $0$ is a multiple of every whole number, but it is not a factor of anything except itself — you can't divide by zero.
  • The factors of a number always come in pairs whose product is the number: if $a$ is a factor of $24$, so is $24/a$. The pairs of $24$ are $(1,24), (2,12), (3,8), (4,6)$ — and then they start repeating.

2. Divisibility rules

Before factoring a number, it helps to know which small numbers are likely to divide it. The divisibility rules let you check this almost instantly without doing the long division.

DivisorTestReason in one sentence
$2$Last digit is $0, 2, 4, 6, 8$.The last digit determines the parity; the rest of the number is already a multiple of $10$, hence of $2$.
$3$Sum of digits is divisible by $3$.Because $10 \equiv 1 \pmod{3}$, every place value contributes its digit value modulo $3$.
$4$The last two digits form a number divisible by $4$.Everything past the tens place is a multiple of $100 = 4 \cdot 25$, hence of $4$.
$5$Last digit is $0$ or $5$.Same reasoning as for $2$ — the last digit decides.
$6$Divisible by both $2$ and $3$.$6 = 2 \cdot 3$ and these two factors are coprime, so a number divisible by both is divisible by their product.
$9$Sum of digits is divisible by $9$.Same trick as for $3$: $10 \equiv 1 \pmod{9}$.
$10$Last digit is $0$.Trivially — base $10$.

The digit-sum tests for $3$ and $9$ feel like magic the first time, but they're a direct consequence of place value. Write $3{,}471$ as $3 \cdot 1000 + 4 \cdot 100 + 7 \cdot 10 + 1$. Modulo $9$, every power of $10$ becomes $1$, so the number is congruent to $3 + 4 + 7 + 1 = 15$. And $15$ is divisible by $3$ (so $3{,}471$ is), but not by $9$ (so $3{,}471$ isn't).

Use them in factoring

When trying to find factors of a number, hit it with the divisibility tests before reaching for long division. Most composite numbers under $1000$ reveal at least one small prime factor instantly.

3. Prime numbers

Some whole numbers can be split further; some can't.

  • $12 = 2 \cdot 6 = 3 \cdot 4$ — splits into smaller factors.
  • $7$ — its only factors are $1$ and $7$ itself; no smaller piece works.

Numbers like $7$ are the building blocks of multiplication. They're called primes.

Prime number

A whole number greater than $1$ whose only positive factors are $1$ and itself. A number greater than $1$ that has any other factor is called composite.

The first dozen primes are $2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, \ldots$. Note three things about this list:

  • $2$ is the only even prime. Every other even number has $2$ as a factor.
  • The list thins out as you go but never stops. Euclid proved roughly $2{,}300$ years ago that there are infinitely many primes — see the historical note below.
  • $1$ is missing. By the modern convention, $1$ is not prime — for good reason, explained next.

Why $1$ doesn't count as prime

By the literal definition above, $1$ would qualify: its only positive factor is itself (which is also $1$). So why exclude it? Because if $1$ were prime, the next big theorem we'll meet — the uniqueness of prime factorization — would fail. We could write $12 = 2 \cdot 2 \cdot 3$, but also $12 = 1 \cdot 2 \cdot 2 \cdot 3$, or $12 = 1 \cdot 1 \cdot 1 \cdot 2 \cdot 2 \cdot 3$, and so on forever. To make the theorem true as stated, $1$ has to be excluded. Convention won out over a literal reading.

Historical note: Euclid's proof

Around 300 BCE, Euclid showed there are infinitely many primes. Suppose the list ended at some largest prime $p$. Multiply every prime together and add $1$: the result $N = 2 \cdot 3 \cdot 5 \cdots p + 1$ leaves remainder $1$ when divided by any prime in the list. So either $N$ itself is a new prime, or its prime factors are all primes not in our list. Either way, the list wasn't complete — contradiction. It's a one-paragraph proof that has stood unchanged for over two millennia.

4. The fundamental theorem of arithmetic

This is the big result that justifies caring about primes in the first place:

Every whole number greater than $1$ can be written as a product of primes in exactly one way, up to the order of the factors.

Two halves to that statement:

  • Existence. Every number bigger than $1$ has at least one prime factorization. (If it's prime, that's the factorization; if it's composite, factor it once, then factor each piece, and so on. Numbers don't shrink forever, so the process stops.)
  • Uniqueness. No number has two genuinely different prime factorizations. $12 = 2 \cdot 2 \cdot 3$ is the only way to write it as primes — you might shuffle the order ($3 \cdot 2 \cdot 2$), but the multiset of primes is fixed.

The uniqueness piece is the surprising one. It says that primes are not just some way to break a number down; they are the way. Every whole number has a fingerprint — its list of prime factors with multiplicities — and the fingerprint is uniquely its own.

In symbols, every whole number $n > 1$ has a unique expression of the form

$$ n = p_1^{a_1} \cdot p_2^{a_2} \cdot \ldots \cdot p_k^{a_k} $$

where $p_1 < p_2 < \ldots < p_k$ are distinct primes and the $a_i$ are positive whole numbers. For example, $360 = 2^3 \cdot 3^2 \cdot 5$ — and that's the only way.

Why this matters

Almost every fact you learn about whole numbers eventually traces back to prime factorization. GCD and LCM are read off the factorizations; tests for perfect squares and cubes are read off the exponents; the structure of fractions in lowest terms is determined by them; and modern cryptography (RSA) relies on the fact that finding the factorization of a large number is, as far as we know, computationally hard.

5. Finding prime factorizations

The practical procedure: peel off small prime factors one at a time. A "factor tree" is the standard picture — split the number into any two factors, then split each of those, and continue until every leaf is prime.

360 4 90 2 2 9 10 3 3 2 5 360 = 2 · 2 · 2 · 3 · 3 · 5 = 2³ · 3² · 5

The tree starts with $360$ at the top. At each step, we pick any factorization (we picked $4 \cdot 90$, but $8 \cdot 45$ or $6 \cdot 60$ would have worked just as well — they'd lead to a different-looking tree with the same leaves, by the uniqueness theorem). Composite numbers continue branching; primes (in orange) become leaves.

Read off the leaves and you have the prime factorization: $2 \cdot 2 \cdot 2 \cdot 3 \cdot 3 \cdot 5$, which is $2^3 \cdot 3^2 \cdot 5$.

A more systematic alternative — useful for big numbers — is to peel off the smallest prime factor at each step:

$$ 360 \xrightarrow{\div 2} 180 \xrightarrow{\div 2} 90 \xrightarrow{\div 2} 45 \xrightarrow{\div 3} 15 \xrightarrow{\div 3} 5 \xrightarrow{\div 5} 1. $$

The primes you divided by, in order, are the prime factorization: $2, 2, 2, 3, 3, 5$. Same answer, no branching. Pick whichever method you prefer.

6. GCD and LCM

Two natural questions about a pair of whole numbers:

  • What's the largest number that divides both? Their greatest common divisor, GCD$(a, b)$.
  • What's the smallest positive number that both divide into? Their least common multiple, LCM$(a, b)$.

Once you have prime factorizations, both answers fall out without effort. Write both numbers as products of the same set of primes (with exponent $0$ where a prime is absent):

$$ 12 = 2^2 \cdot 3^1 \cdot 5^0, \qquad 18 = 2^1 \cdot 3^2 \cdot 5^0. $$
  • GCD takes the minimum exponent in each prime: $\gcd(12, 18) = 2^1 \cdot 3^1 = 6$.
  • LCM takes the maximum exponent in each prime: $\mathrm{lcm}(12, 18) = 2^2 \cdot 3^2 = 36$.

One nice consequence — and a great identity to keep in mind:

$$ \gcd(a, b) \cdot \mathrm{lcm}(a, b) = a \cdot b. $$

For $12$ and $18$: $6 \cdot 36 = 216 = 12 \cdot 18$ ✓. This identity follows directly from the min-and-max rule: $\min(x, y) + \max(x, y) = x + y$, applied exponent by exponent.

When you'd actually use this

GCD is what you need to reduce a fraction to lowest terms ($\tfrac{12}{18} = \tfrac{2}{3}$ after dividing both by $\gcd(12,18) = 6$). LCM is what you need to find a common denominator when adding fractions. Both appear in the next topic, where they earn their keep.

7. Playground: the Sieve of Eratosthenes

Eratosthenes (3rd century BCE) gave the oldest known algorithm for listing primes: write the numbers in a grid, cross out multiples of $2$, then multiples of $3$, and so on. Whatever survives is prime. Click the button repeatedly to walk through the sieving step by step — and watch the primes emerge from the noise.

Click Next prime to begin sieving.
Prime Current sieving step Crossed out (composite)
The clever optimization

You only need to sieve up to $\sqrt{n}$. Any composite number $\leq n$ must have a prime factor $\leq \sqrt{n}$ — otherwise its two factors would multiply to more than $n$. For $n = 100$, that means once you've sieved multiples of $2, 3, 5, 7$, everything else uncrossed is prime, no matter how big. Try clicking past $7$ and watch: nothing new gets crossed.

8. Common pitfalls

Treating $1$ as prime

$1$ is not prime — it's excluded by convention, so that the fundamental theorem of arithmetic can say "exactly one factorization" instead of "infinitely many trivial variations." Calling $1$ prime is a common reflex, and it breaks the cleanest theorem in elementary number theory.

Confusing factor with multiple

"$6$ is a factor of $24$" and "$6$ is a multiple of $24$" are not the same — the second is false. Factors are smaller-than-or-equal; multiples are larger-than-or-equal. The two words go in opposite directions, even though they describe the same multiplication.

Forgetting to factor all the way down

A factor tree isn't done until every leaf is prime. $24 = 4 \cdot 6$ is a start, but $4$ and $6$ are both composite — keep going: $4 = 2 \cdot 2$ and $6 = 2 \cdot 3$, giving $24 = 2^3 \cdot 3$. Stopping early gives a factorization, but not the prime factorization.

GCD vs LCM mix-up

GCD uses minimum exponents (because it has to divide both numbers, so it can't have more of any prime than either of them). LCM uses maximum exponents (because both numbers have to divide it). If you reverse them, the GCD comes out bigger than either input — your sign the rule's flipped.

9. Worked examples

Example 1 · List all factors of $36$

Pair up: $1 \times 36$, $2 \times 18$, $3 \times 12$, $4 \times 9$, $6 \times 6$. (At $6$, the pair would repeat.)

Factors: $\boxed{1, 2, 3, 4, 6, 9, 12, 18, 36}$ — that's nine factors. (A perfect square always has an odd number of factors, because one of its "pairs" is the square root paired with itself.)

Example 2 · Is $4{,}521$ divisible by $3$?

Use the digit-sum rule: $4 + 5 + 2 + 1 = 12$. Is $12$ divisible by $3$? Yes ($12 = 3 \cdot 4$). So $4{,}521$ is divisible by $3$.

Check: $4{,}521 \div 3 = 1{,}507$ ✓.

(Bonus: is it divisible by $9$? Digit sum is $12$, which is not divisible by $9$, so no.)

Example 3 · Prime factorize $84$

Peel off the smallest prime factor at each step:

$$ 84 \xrightarrow{\div 2} 42 \xrightarrow{\div 2} 21 \xrightarrow{\div 3} 7 \xrightarrow{\div 7} 1. $$

Primes used: $2, 2, 3, 7$.

$$ 84 = 2^2 \cdot 3 \cdot 7. $$

Check: $4 \cdot 3 \cdot 7 = 84$ ✓.

Example 4 · $\gcd(48, 60)$ and $\mathrm{lcm}(48, 60)$

Factor both: $48 = 2^4 \cdot 3$ and $60 = 2^2 \cdot 3 \cdot 5$.

GCD takes minimum exponents: $\gcd(48, 60) = 2^{\min(4,2)} \cdot 3^{\min(1,1)} \cdot 5^{\min(0,1)} = 2^2 \cdot 3 = 12$.

LCM takes maximum exponents: $\mathrm{lcm}(48, 60) = 2^{\max(4,2)} \cdot 3^{\max(1,1)} \cdot 5^{\max(0,1)} = 2^4 \cdot 3 \cdot 5 = 240$.

Check the identity: $12 \cdot 240 = 2880 = 48 \cdot 60$ ✓.

Example 5 · Is $97$ prime?

By the $\sqrt{n}$ trick: we only need to check primes up to $\sqrt{97} \approx 9.85$. So check $2, 3, 5, 7$:

  • $97$ is odd, so not divisible by $2$.
  • Digit sum $9 + 7 = 16$, not divisible by $3$.
  • Doesn't end in $0$ or $5$, not divisible by $5$.
  • $97 \div 7 = 13.857\ldots$, not a whole number.

No prime $\leq \sqrt{97}$ divides $97$. So $97$ is $\boxed{\text{prime}}$.

Sources & further reading

Test your understanding

A quiz that builds from easy to hard. Pick an answer to get instant feedback and a worked explanation. Your progress is saved in this browser — come back anytime to continue.

Question 1 of N
0 correct