beginner18 min

Number Systems and Divisibility Rules

How place value works and how to tell whether a number divides evenly by 2 through 11 without doing long division.

What you'll learn

  • Explain how place value determines a digit's contribution to a number's value
  • Apply the divisibility rules for 2, 3, 4, 5, 6, 8, 9, 10, and 11 to a given number
  • Classify a whole number as prime, composite, or neither

Explanation

Almost every shortcut in quantitative aptitude rests on one idea: a number is really just a sum of digits multiplied by place value (powers of ten). The number 4536 means 4×1000 + 5×100 + 3×10 + 6×1. Divisibility rules exist because, once you expand a number that way, you can prove which digits actually matter for a given divisor and ignore the rest — that's what turns "divide 4536 by 11 the long way" into a ten-second mental check.

Here are the rules worth memorizing, from simplest to least obvious:

  • Divisible by 2: last digit is even (0, 2, 4, 6, 8).
  • Divisible by 5: last digit is 0 or 5.
  • Divisible by 10: last digit is 0.
  • Divisible by 4: the last two digits, read as a two-digit number, are divisible by 4.
  • Divisible by 8: the last three digits, read as a number, are divisible by 8.
  • Divisible by 3: the sum of all digits is divisible by 3.
  • Divisible by 9: the sum of all digits is divisible by 9.
  • Divisible by 6: the number is divisible by both 2 and 3.
  • Divisible by 11: starting from the rightmost digit, alternately add and subtract digits; if that alternating sum is divisible by 11 (including 0), so is the original number.

Worked example. Take 4536. Last digit is 6 (even), so it's divisible by 2. Digit sum is 4+5+3+6 = 18, which is divisible by both 3 and 9, so 4536 is divisible by 3, 9, and (since it's also divisible by 2) by 6. Last two digits are "36", and 36 ÷ 4 = 9 exactly, so 4536 is divisible by 4. For 11: reading from the right with alternating signs gives 6 − 3 + 5 − 4 = 4, which is not divisible by 11, so 4536 is not divisible by 11. One number, five divisibility facts, no long division.

Two more definitions matter here. A factor of a number divides it with no remainder; a multiple of a number is what you get multiplying it by a whole number. A prime number has exactly two distinct factors — 1 and itself — so 2, 3, 5, 7, 11, and 13 are prime, but 1 is not prime (it has only one factor) and neither is it composite. A composite number has more than two factors, like 12 (factors 1, 2, 3, 4, 6, 12). The fastest way to test whether n is prime by hand is trial division only up to √n: if nothing from 2 up to √n divides n evenly, nothing larger can either, because any factor pair (a, b) with a×b = n must have at least one of a, b no bigger than √n.

These rules aren't just party tricks — they're the fastest way to simplify fractions, spot common factors under time pressure, and sanity-check a long-division answer before you trust it.

Divisibility rules quick reference

Divisor 2: last digit even. Divisor 3: digit sum divisible by 3. Divisor 4: last two digits divisible by 4. Divisor 5: last digit 0 or 5. Divisor 6: divisible by both 2 and 3. Divisor 8: last three digits divisible by 8. Divisor 9: digit sum divisible by 9. Divisor 10: last digit 0. Divisor 11: alternating digit sum (from the right) divisible by 11.

Example

Computing a digit sum is the shared basis of the divisibility rules for 3 and 9.

function digitSum(n) {
  return String(Math.abs(n))
    .split("")
    .reduce((sum, digit) => sum + Number(digit), 0);
}
// Example: digitSum(4536) -> 18 (4+5+3+6), and 18 is divisible by 9, so 4536 is divisible by 9.

Guided exercise

Guided exercise

Write divisibilityRuleCheck(n, divisor) where n is a non-negative integer and divisor is one of 2, 3, 4, 5, 6, 8, 9, 10, or 11. Implement the actual shortcut rule for that divisor from this lesson (last digit, digit sum, last two/three digits, or alternating sum) and return true or false for whether n is evenly divisible by divisor.

Checks: Correctly applies the digit-sum rule for 9 · Correctly applies the alternating-sum rule for 11 · plus 1 hidden check

Code editor. Press Escape then Tab to leave the editor if keyboard focus becomes trapped. Press Control+Shift+M inside the editor to toggle Tab-key focus trapping.

Loading editor…

Stuck? Get a hint.

Independent exercise

Independent exercise

Write classifyNumber(n) where n is an integer. Return the string 'prime' if n is a prime number, 'composite' if n is a composite number, or 'neither' if n is less than 2 (this covers 0, 1, and negative numbers). Use trial division only up to the square root of n for efficiency.

Checks: Correctly identifies a prime number · Correctly identifies a composite number · plus 1 hidden check

Code editor. Press Escape then Tab to leave the editor if keyboard focus becomes trapped. Press Control+Shift+M inside the editor to toggle Tab-key focus trapping.

Loading editor…

Stuck? Get a hint.

Common mistakes

  • Applying the divisibility-by-3 digit-sum rule to check divisibility by 4 or 8 — those two rules depend on the last two or three digits, not the sum of all digits.
  • Treating 1 as a prime number — by definition a prime has exactly two distinct factors, and 1 only has one.
  • Checking every possible divisor up to n when testing primality instead of stopping at the square root of n, which wastes time without finding anything new.

Knowledge check

Knowledge check

1. Using the digit-sum rule, which of these numbers is divisible by 9?
2. Which statement correctly defines a prime number?
3. A cashier wants to quickly check whether 3,824 forms can be split evenly into groups of 4 without doing full long division. Which shortcut should they use?

Takeaway

Every divisibility rule is a shortcut derived from place value, so you never need long division just to know whether a number splits evenly.

Summary

Numbers are built from digits weighted by place value, and that structure produces fast divisibility tests for 2 through 11 based on the last digit, last two or three digits, or a digit sum. Primes have exactly two factors, composites have more, and trial division up to the square root is enough to tell them apart.

Your notes

Notes save automatically.

Finished this lesson?

Mark it complete to track your progress and schedule a future review.

Next: LCM and HCF