Number System and Divisibility

beginner26 min read

The sets of numbers, the divisibility rules from 2 to 11 (except 7), counting factors and their sum from a prime factorisation, and unit-digit cyclicity for powers — the toolkit that makes the rest of arithmetic fast.

Concept

The sets of numbers

Numbers stack in layers, each containing the one before it.

  • Natural numbers: 1, 2, 3, ... — the counting numbers.
  • Whole numbers: the naturals together with 0.
  • Integers: the whole numbers together with their negatives: ..., -2, -1, 0, 1, 2, ...
  • Rational numbers: anything expressible as a ratio p/q of two integers with q not zero. Their decimal form either terminates (0.75) or repeats (0.333...).
  • Irrational numbers: real numbers that are not rational — their decimals neither terminate nor repeat, such as the square root of 2 or pi.
  • Real numbers: the rationals and irrationals together.

Among the naturals, a prime has exactly two factors, 1 and itself (2, 3, 5, 7, 11, ...); a composite has more than two. 1 is neither. 2 is the only even prime.

Method

Divisibility rules

A number is divisible by:

  • 2 — its last digit is even.
  • 3 — the sum of its digits is divisible by 3.
  • 4 — the number formed by its last two digits is divisible by 4.
  • 5 — its last digit is 0 or 5.
  • 6 — it passes the tests for both 2 and 3.
  • 8 — the number formed by its last three digits is divisible by 8.
  • 9 — the sum of its digits is divisible by 9.
  • 10 — its last digit is 0.
  • 11 — the difference between the sum of the digits in odd positions and the sum in even positions is 0 or a multiple of 11.

For a composite divisor made of coprime parts, test the parts: divisibility by 12 means divisibility by 3 and by 4; by 72 means by 8 and by 9.

Method

Counting factors from a prime factorisation

Write the number as a product of prime powers: N equals p1 to the power a, times p2 to the power b, times p3 to the power c, and so on.

  • Number of factors equals (a plus 1) times (b plus 1) times (c plus 1) ...
  • Number of factors that are perfect squares counts only the even exponents 0, 2, 4, ... in each bracket.
  • Sum of all factors equals the product, over each prime, of (p to the power (exponent plus 1) minus 1) divided by (p minus 1).

A number has an odd number of factors exactly when it is a perfect square, because only then does one factor (the square root) pair with itself.

Concept

Unit digit of a power

The unit digit of successive powers of a fixed digit repeats in a short cycle.

  • 2: 2, 4, 8, 6 (length 4)
  • 3: 3, 9, 7, 1 (length 4)
  • 7: 7, 9, 3, 1 (length 4)
  • 8: 8, 4, 2, 6 (length 4)
  • 4: 4, 6 (length 2); 9: 9, 1 (length 2)
  • 0, 1, 5, 6: always 0, 1, 5, 6 (length 1)

To find the unit digit of a base raised to a power, take the unit digit of the base, find the remainder when the exponent is divided by the cycle length, and read that position in the cycle. A remainder of 0 means the last entry of the cycle.

Worked example

Worked example: divisibility checks

Is 453,192 divisible by 8? By 9?

By 8: look at the last three digits, 192. Since 192 divided by 8 is 24, a whole number, 453,192 is divisible by 8.

By 9: the digit sum is 4 plus 5 plus 3 plus 1 plus 9 plus 2, which is 24. Since 24 is not divisible by 9, 453,192 is not divisible by 9. (It is divisible by 3, because 24 is.)

Worked example

Worked example: counting factors

How many factors does 360 have, and how many of them are odd?

Prime factorise: 360 equals 2 to the power 3, times 3 to the power 2, times 5 to the power 1.

Number of factors: (3 plus 1) times (2 plus 1) times (1 plus 1), which is 4 times 3 times 2, equal to 24.

Odd factors: ignore the power of 2 (an odd factor uses 2 to the power 0). That leaves (2 plus 1) times (1 plus 1), which is 3 times 2, equal to 6.

Worked example

Worked example: unit digit of a power

Find the unit digit of 7 raised to the power 83.

The unit digit of 7's powers cycles as 7, 9, 3, 1, with length 4.

Divide the exponent by 4: 83 divided by 4 leaves a remainder of 3.

The 3rd entry in the cycle 7, 9, 3, 1 is 3. So the unit digit of 7 to the power 83 is 3.

As a check, 7 to the power 4 ends in 1, so 7 to the power 80 ends in 1, and 7 to the power 83 ends like 7 cubed, which is 343 — unit digit 3.

Common mistake

Common mistakes

  • Calling 1 a prime. A prime has exactly two distinct factors; 1 has one.
  • Testing divisibility by 8 with two digits. Use the last three digits for 8, two for 4.
  • Forgetting to reduce the exponent modulo the cycle length for unit digits. A remainder of 0 points to the last entry of the cycle, not the first.
  • Adding 1 to the wrong number when counting factors. It is (exponent plus 1) for each prime, then multiply the brackets.
  • Assuming an even number of factors. Perfect squares have an odd number.
  • Mixing up the rule for 11. It is the alternating sum (odd positions minus even positions), not the plain digit sum.
Quick revision

Quick revision

  • Sets: natural, whole, integer, rational (terminating or repeating decimals), irrational, real. Primes have exactly two factors; 1 is neither; 2 is the only even prime.
  • Divisibility: 2 (even last digit), 3 (digit sum), 4 (last two digits), 5 (0 or 5), 6 (2 and 3), 8 (last three digits), 9 (digit sum), 11 (alternating digit sum). For composite divisors, test coprime parts.
  • Factor count from N = p1^a p2^b ... is (a+1)(b+1)... ; odd number of factors means a perfect square.
  • Unit digit of a power: take the base's unit digit, reduce the exponent modulo the cycle length (usually 4), read that position; remainder 0 means the last entry.
Practice

Practice

  1. Is 7,20,918 divisible by 11?
  2. How many factors does 1,200 have?
  3. Find the unit digit of 3 raised to the power 100.
  4. What is the smallest number that must be added to 5,834 to make it divisible by 9?
  5. How many numbers between 1 and 200 are divisible by 6 but not by 4?
  6. The number 34A6 is divisible by 4. What digit can A be?
  7. What is the largest three-digit number that is exactly divisible by 17?
  8. Find the remainder when the sum 1 + 2 + 3 + ... + 100 is divided by 7.