Divisibility Rules (2 to 12): The Definitive Guide

A rigorous number theory masterclass on rapid divisibility tests. Explore the modular arithmetic proofs for powers of ten, the digit-sum rules for 3 and 9, the truncated doubling algorithm for 7, alternating sums for 11, and composite rules on SolveCalc (calcsolves.net).

Official SolveCalc Educational Resource (Formerly CalcSolver / Calc Solver)

Test Divisibility Instantly with SolveCalc Pro

Input any integer to test divisibility across 2 through 100 instantly with the free SolveCalc (solvecalc pro / solvecalcpro) engine.

Divisibility Tester Factor Generator Prime Detective

Curriculum Masterclass: Number Theory & Modular Divisibility

From base-10 positional algebra to algorithmic residue checks and cryptographic integrity checks.

1

1. Foundational Theory: The Mathematical Definition of Divisibility

In formal number theory, an integer $a$ is said to be divisible by a non-zero integer $b$ (written mathematically as $b \mid a$, read "$b$ divides $a$") if and only if there exists another integer $k \in \mathbb{Z}$ such that:

a = k \cdot b \quad \text{or equivalently} \quad a \equiv 0 \pmod b

In elementary arithmetic, this means that when $a$ is divided by $b$, the remainder is strictly zero ($r = 0$).

A divisibility rule is an algorithmic shortcut that determines whether $b \mid a$ by inspecting only a subset of the decimal digits of $a$ or by computing a rapid mental calculation (such as adding digits), completely bypassing the computational overhead of standard long division.

2

2. Governing Mathematical Proofs via Modular Arithmetic

Every divisibility shortcut stems directly from expanding a number into its base-10 positional polynomial. Any positive integer $N$ can be uniquely written as:

N = d_n 10^n + d_{n-1} 10^{n-1} + \dots + d_2 10^2 + d_1 10^1 + d_0

Category A: Last-Digits Rules (Divisors of $10^k$: 2, 4, 8, 5, 10)

Because $10 = 2 \times 5$, powers of 10 contain high multiplicities of 2 and 5:

  • Rule for 2 and 5 ($10^1 \equiv 0$): Since $10 \equiv 0 \pmod 2$ and $10 \equiv 0 \pmod 5$, all terms containing $10^1$ or higher vanish modulo 2 and 5: $$N \equiv d_0 \pmod 2 \quad \text{and} \quad N \equiv d_0 \pmod 5$$ Criterion: Check only the single last digit $d_0$. For 2, $d_0 \in \{0, 2, 4, 6, 8\}$; for 5, $d_0 \in \{0, 5\}$.
  • Rule for 4 and 25 ($10^2 \equiv 0$): Since $100 \equiv 0 \pmod 4$ and $100 \equiv 0 \pmod{25}$, every term with $10^2$ or higher vanishes: $$N \equiv 10d_1 + d_0 \pmod 4$$ Criterion: Check the two-digit integer formed by the last two digits ($d_1 d_0$).
  • Rule for 8 ($10^3 \equiv 0$): Since $1{,}000 \equiv 0 \pmod 8$, $N \equiv 100d_2 + 10d_1 + d_0 \pmod 8$. Criterion: Check the three-digit integer formed by the last three digits ($d_2 d_1 d_0$).

Category B: Digit-Sum Rules (3 and 9)

Notice that $10 \equiv 1 \pmod 9$ and $10 \equiv 1 \pmod 3$. By the properties of modular exponentiation, $10^k \equiv 1^k \equiv 1 \pmod 9$ for all $k \ge 0$. Substituting 1 for every $10^k$ in the base-10 expansion yields:

N \equiv d_n(1) + d_{n-1}(1) + \dots + d_1(1) + d_0 \equiv \sum_{i=0}^n d_i \pmod 9

The Digital Root Theorem: A number is divisible by 3 (or 9) if and only if the sum of its decimal digits is divisible by 3 (or 9).

Category C: Alternating Digit-Sum Rule (11)

Notice that $10 \equiv -1 \pmod{11}$. Therefore, $10^k \equiv (-1)^k \pmod{11}$. Even powers produce $+1$ and odd powers produce $-1$:

N \equiv d_0 - d_1 + d_2 - d_3 + d_4 - \dots \pmod{11}

Criterion: An integer is divisible by 11 if and only if the difference between the sum of digits in odd positions and the sum of digits in even positions is a multiple of 11 (such as $-11, 0, 11, 22$).

Category D: The Truncated Doubling Algorithm (7)

Any integer can be split into its units digit $b$ and the remaining truncated integer $a$ such that $N = 10a + b$. Notice that:

10a + b \equiv 0 \pmod 7 \iff 10a + b - 21b \equiv 0 \pmod 7 \iff 10a - 20b \equiv 0 \pmod 7

Factoring out 10 (which is coprime to 7, $\gcd(10, 7) = 1$):

10(a - 2b) \equiv 0 \pmod 7 \iff a - 2b \equiv 0 \pmod 7

Criterion: Double the last digit and subtract it from the truncated remainder. If the difference is a multiple of 7, $N$ is divisible by 7.

Category E: Composite Rules via Coprime Factorization (6 and 12)

By the Chinese Remainder Theorem, if $m = p \cdot q$ where $\gcd(p, q) = 1$, then:

m \mid N \iff (p \mid N) \land (q \mid N)
  • Rule for 6 ($2 \times 3$): The number must be even (divisible by 2) AND the sum of its digits must be a multiple of 3.
  • Rule for 12 ($3 \times 4$): The sum of digits must be divisible by 3 AND the last two digits must be divisible by 4.
3

3. Comparative Matrix: Divisibility Rules Master Cheat Sheet

Quick lookup reference for testing any integer from 2 to 12:

Divisor Algorithmic Test Worked Positive Example Worked Negative Example
2 Last digit is even ($0, 2, 4, 6, 8$) $1{,}358$ (ends in 8 $\to$ Yes) $1{,}357$ (ends in 7 $\to$ No)
3 Sum of all digits is a multiple of 3 $492 \to 4+9+2=15$ ($15 \div 3 = 5$ $\to$ Yes) $493 \to 16$ (No)
4 Last two digits form a number divisible by 4 $5{,}328 \to 28$ ($28 \div 4 = 7$ $\to$ Yes) $5{,}326 \to 26$ (No)
5 Last digit is 0 or 5 $4{,}895$ (ends in 5 $\to$ Yes) $4{,}892$ (No)
6 Divisible by both 2 (even) AND 3 (digit sum) $738 \to$ Even, and $7+3+8=18$ $\to$ Yes $735 \to$ Odd (No)
7 Truncated remainder minus $2 \times (\text{last digit})$ is a multiple of 7 $483 \to 48 - (2 \times 3) = 42$ ($42 \div 7 = 6$ $\to$ Yes) $485 \to 48 - 10 = 38$ (No)
8 Last three digits form a number divisible by 8 $19{,}128 \to 128$ ($128 \div 8 = 16$ $\to$ Yes) $19{,}124 \to 124$ (No)
9 Sum of all digits is a multiple of 9 $2{,}871 \to 2+8+7+1 = 18$ ($18 \div 9 = 2$ $\to$ Yes) $2{,}872 \to 19$ (No)
10 Last digit is 0 $14{,}590$ (ends in 0 $\to$ Yes) $14{,}595$ (No)
11 Alternating sum of digits $(d_0 - d_1 + d_2 \dots)$ is a multiple of 11 $86{,}757 \to (7+7+8) - (5+6) = 22 - 11 = 11$ $\to$ Yes $86{,}758 \to 10$ (No)
12 Divisible by both 3 (digit sum) AND 4 (last 2 digits) $1{,}428 \to 1+4+2+8=15$ (div by 3) and $28 \div 4 = 7$ $\to$ Yes $1{,}426 \to 26$ not div by 4 (No)
4

4. Step-by-Step Worked Case Studies with Real Numbers

Case Study 1: Multi-Divisor Screening of an Intermediate Integer

Problem: Determine all divisors among $\{2, 3, 4, 5, 6, 8, 9, 10, 11, 12\}$ for the number $10{,}368$.

  1. Divisible by 2: Last digit is 8 (even) $\implies$ Yes.
  2. Divisible by 3 and 9: Sum of digits: $1 + 0 + 3 + 6 + 8 = 18$.
    • $18 \div 3 = 6 \implies$ Yes to 3.
    • $18 \div 9 = 2 \implies$ Yes to 9.
  3. Divisible by 4 and 8:
    • Last 2 digits: $68 \div 4 = 17 \implies$ Yes to 4.
    • Last 3 digits: $368 \div 8 = 46 \implies$ Yes to 8.
  4. Divisible by 5 and 10: Last digit is 8 (not 0 or 5) $\implies$ No to 5, No to 10.
  5. Divisible by 6: Passed 2 and 3 $\implies$ Yes to 6.
  6. Divisible by 12: Passed 3 and 4 $\implies$ Yes to 12.
  7. Divisible by 11: Alternating sum: $(8 + 3 + 1) - (6 + 0) = 12 - 6 = 6$ (not a multiple of 11) $\implies$ No to 11.
  8. Final Divisors: $10{,}368$ is divisible by **2, 3, 4, 6, 8, 9, and 12**.

Case Study 2: Multi-Step Recursive Truncation Test for 7

Problem: Test whether $39{,}823$ is divisible by 7 without long division.

  1. Iteration 1:
    • Truncated number: $3{,}982$. Last digit: $3$.
    • Subtract double: $3{,}982 - (2 \times 3) = 3{,}982 - 6 = \mathbf{3{,}976}$.
  2. Iteration 2:
    • Truncated number: $397$. Last digit: $6$.
    • Subtract double: $397 - (2 \times 6) = 397 - 12 = \mathbf{385}$.
  3. Iteration 3:
    • Truncated number: $38$. Last digit: $5$.
    • Subtract double: $38 - (2 \times 5) = 38 - 10 = \mathbf{28}$.
  4. Evaluate final residue: $28 \div 7 = 4$ (exact integer!).
  5. Conclusion: $39{,}823$ is strictly divisible by 7 ($39{,}823 = 5{,}689 \times 7$).

Case Study 3: ISBN-10 Barcode Checksum Algorithm

Scenario: International Standard Book Numbers (ISBN-10) use a weighted modular checksum based on modulo 11. An ISBN-10 string $x_1 x_2 \dots x_{10}$ is valid if and only if:

$$\sum_{i=1}^{10} (11 - i) \cdot x_i \equiv 0 \pmod{11}$$

A library systems programmer validates the ISBN: 0-306-40615-2.

  1. Multiply each digit by weights from 10 down to 1:
    • $10(0) = 0$
    • $9(3) = 27$
    • $8(0) = 0$
    • $7(6) = 42$
    • $6(4) = 24$
    • $5(0) = 0$
    • $4(6) = 24$
    • $3(1) = 3$
    • $2(5) = 10$
    • $1(2) = 2$
  2. Sum the weighted products: $$\text{Sum} = 0 + 27 + 0 + 42 + 24 + 0 + 24 + 3 + 10 + 2 = \mathbf{132}$$
  3. Check divisibility by 11 using the alternating sum rule on 132: $$(2 + 1) - 3 = 3 - 3 = 0 \implies 132 \text{ is divisible by } 11 \quad (132 = 12 \times 11)$$
  4. Conclusion: The ISBN-10 is mathematically validated with zero checksum errors.
5

5. Common Pitfalls & Calculation Traps

Avoid these classic misconceptions when using divisibility tests:

  • The False Composite Factorization Trap: Attempting to test divisibility by 8 by testing whether a number is divisible by 4 and 2. This fails completely! For example, 12 is divisible by 4 and 2, but $12 \div 8 = 1.5$ (not divisible). You can only combine rules for composite divisors if the factors are coprime ($\gcd(p, q) = 1$). Since $\gcd(4, 2) = 2 \neq 1$, testing 4 and 2 does not prove divisibility by 8.
  • Confusing the Rule of 4 with the Rule of 2: Testing only the last digit for 4. The number 26 ends in 6 (divisible by 2), but $26 \div 4 = 6.5$. The test for 4 requires checking the full two-digit ending (26 is not divisible by 4).
  • Forgetting 0 as a Multiple: When calculating alternating digit sums for 11 or differences for 7, getting 0 and concluding the number is not divisible. Zero is a multiple of every integer ($0 = 0 \times k$). A difference of 0 guarantees divisibility!
  • Adding Non-Decimal Digits: Using digit sum rules in other bases (such as binary or hexadecimal) without adjusting for the base. Digit sum tests work for 9 in base-10 because $10 - 1 = 9$. In hexadecimal (base-16), digit sums test divisibility by $16 - 1 = 15$.
6

6. Real-World & Industrial Applications

Divisibility algorithms power fundamental computational and security infrastructure:

  • Cryptographic Primes & RSA Key Generation: Before executing expensive probabilistic primality tests (such as Miller-Rabin) on 2048-bit integers, cryptographic engines run rapid trial divisibility tests using small primes ($2, 3, 5, 7, 11 \dots$) to instantly discard over $80\%$ of composite candidate numbers.
  • Credit Card Validation (Luhn Algorithm): The Luhn algorithm used on Visa, Mastercard, and American Express cards computes a modified digit sum modulo 10 to instantly detect accidental mistyping of account numbers.
  • Data Packet Parity & CRC Checksums: Network protocols and computer memory (ECC RAM) compute cyclic redundancy checks (CRC) using polynomial division over Galois fields, identical in mathematical structure to base-10 divisibility rules.
7

7. Frequently Asked Questions (FAQ)

Why does the digit-sum rule work for 3 and 9?

Because every power of 10 is congruent to 1 modulo 9 ($10^k \equiv 1 \pmod 9$ and $10^k \equiv 1 \pmod 3$). Expanding any integer into its base-10 positional polynomial and reducing modulo 9 collapses each power of 10 to 1, leaving only the sum of its decimal digits.

What is the fastest mental math rule for checking divisibility by 7?

Double the last digit and subtract it from the truncated remaining number. If the difference is a multiple of 7 (including 0), the original number is divisible by 7. For example, 343: double 3 is 6; $34 - 6 = 28$. Since $28 \div 7 = 4$, 343 is divisible by 7.

How does the alternating sum rule for 11 work?

Because $10 \equiv -1 \pmod{11}$, powers of 10 alternate between $+1$ and $-1$. Sum digits in odd positions and subtract the sum of digits in even positions. If the difference is a multiple of 11 (including 0), the number is divisible by 11.

Can you test composite numbers like 12, 15, or 18 with divisibility rules?

Yes, by factoring into coprime factors. A number is divisible by 12 if it passes both the 3 and 4 tests ($\gcd(3,4)=1$). For 15, test 3 and 5. For 18, test 2 and 9.

Where can I test divisibility and factors online for free?

You can use the free SolveCalc Pro Divisibility & Factor Tool at calcsolves.net/tools/divisibility (also searched as solvecalc / solvecalcpro), which tests divisibility across any integer and provides complete factor breakdowns.

Is SolveCalc the new version of CalcSolver?

Yes! SolveCalc (calcsolves.net) is the official upgraded continuation of CalcSolver (also known as Calc Solver). All original interactive calculators, formulas, and math tools have been upgraded with enhanced precision, step-by-step solutions, and comprehensive learning guides.