Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 39 ยท Factors, Multiples and Primes

Factors, Multiples and Divisibility

Find factors and multiples of whole numbers, use factor pairs, and apply divisibility rules for 2, 3, 4, 5, 6, 8, 9, 10 and 11 without a calculator.

Whole numbers have a hidden structure. Some divide neatly into others, some do not. Factors and multiples are the two words that describe this structure, and divisibility rules let you test it in seconds without long division.

Everything later in this chapter, primes, prime factorization, HCF and LCM, is built on the ideas here.

Factors

A factor of a number divides it exactly, with no remainder. Since 12 รท 3 = 4 exactly, 3 is a factor of 12. The factors of 12 are 1, 2, 3, 4, 6, 12.

Factors come in pairs that multiply to give the number:

Text
12 = 1 ร— 12 = 2 ร— 6 = 3 ร— 4

To list all factors of n, test whole numbers from 1 upward and write down both numbers of each pair. You can stop when the numbers meet in the middle, because after that you only repeat pairs you already have. For 36 you stop at 6: 1ร—36, 2ร—18, 3ร—12, 4ร—9, 6ร—6. The factors are 1, 2, 3, 4, 6, 9, 12, 18, 36. Notice 6 pairs with itself, so it is listed once. This only happens for square numbers, which therefore have an odd number of factors.

Every number has at least two factors: 1 and itself.

Multiples

A multiple of a number is what you get by multiplying it by a whole number. The multiples of 7 are 7, 14, 21, 28, 35, .... They go on forever.

Factors and multiples are two views of the same fact:

  • 3 is a factor of 12.
  • 12 is a multiple of 3.
Python List factors and multiples

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The loop only goes up to the square root of n: each divisor found also gives its partner n // d. This is the same "stop when they meet" trick used by hand.

Divisibility rules

A divisibility rule tells you whether one number divides another by looking at its digits.

Divisor Rule
2 Last digit is 0, 2, 4, 6 or 8
3 Sum of the digits is divisible by 3
4 Last two digits form a number divisible by 4
5 Last digit is 0 or 5
6 Divisible by both 2 and 3
8 Last three digits form a number divisible by 8
9 Sum of the digits is divisible by 9
10 Last digit is 0
11 Alternating sum of digits is 0 or divisible by 11

Examples.

  • Is 4,728 divisible by 3? The digit sum is 4+7+2+8 = 21, and 21 is divisible by 3, so yes.
  • Is 5,716 divisible by 4? The last two digits give 16, and 16 รท 4 = 4, so yes.
  • Is 918,082 divisible by 11? Alternating sum from the right: 2 - 8 + 0 - 8 + 1 - 9 = -22. Since -22 is divisible by 11, yes.
  • Is 7,128 divisible by 6? It is even, and the digit sum 7+1+2+8 = 18 is divisible by 3, so yes.

Why does the rule for 3 and 9 work? Each power of 10 leaves remainder 1 when divided by 9 (and by 3), so a number leaves the same remainder as its digit sum.

There is no simple one-step rule for 7, though there are tricks. For 7 it is often quicker to divide.

Python Check the rules against real division

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The program tests every number from 100 to 4,999 and counts any case where a rule disagrees with real division. A rule you can trust gives zero disagreements.

Putting it together

Example. Is 3,960 divisible by 8? Last three digits: 960, and 960 รท 8 = 120, so yes. Is it divisible by 9? Digit sum 3+9+6+0 = 18, yes. So 3,960 is divisible by 8 ร— 9 = 72, since 8 and 9 share no common factor.

Combining rules works only for divisors with no common factor: "divisible by 2 and 4" tells you nothing new, but "divisible by 3 and 4" means divisible by 12.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. How many factors does 36 have?

    The factors are 1, 2, 3, 4, 6, 9, 12, 18, 36: nine in total, an odd count because 36 is a square number.
  2. 2. Which number is divisible by 9?

    The digit sum of 4,563 is 18, which is divisible by 9. The others have digit sums 17, 19 and 20.
  3. 3. Is 2,134 divisible by 11?

    From the right, the alternating sum is 4 - 3 + 1 - 2 = 0, and 0 is divisible by 11. Indeed 2,134 = 11 ร— 194.
  4. 4. A number is divisible by both 3 and 4. Which other number must divide it?

    3 and 4 share no common factor, so a number divisible by both is divisible by 3 ร— 4 = 12. It need not be divisible by 8, 9 or 24.

Summary

  • A factor divides a number exactly; factors come in pairs, and you only need to test up to the square root.
  • A multiple is the number times a whole number.
  • Divisibility rules test digits: 2 (last digit), 3 and 9 (digit sum), 4 and 8 (last two or three digits), 5, 10 (last digit), 11 (alternating sum).
  • Combine rules only for divisors with no common factor.

Next: Primes and the Sieve