Introduction

Welcome back to Divisibility Shortcuts! In the first lesson, you discovered that divisibility by 2, 5, and 10 comes down to a single glance at the last digit — a shortcut powered by the way base ten handles multiples of 1010. Now, in this second lesson of five, we move on to two new divisors that demand a different approach: 3 and 9. This time, the last digit alone will not be enough. Instead, you will learn a technique called the digit-sum test, a method that checks all the digits at once. By the end of this lesson, you will be able to test divisibility by 3 and 9 quickly, and you will understand the place-value reasoning that makes the trick work.

When the Last Digit Is Not Enough

Consider the numbers 1313, 2323, 3333, 4343, 5353, 6363, 7373, , and . They all end in , yet only some of them are divisible by (specifically , , and ). The last digit is the same every time, but divisibility changes. This tells us that the last digit cannot be the deciding factor for .

What Is a Digit Sum?

The digit sum of a number is simply the total you get when you add each of its individual digits together. For example:

  • The digit sum of 4747 is 4+7=114 + 7 = 11.
  • The digit sum of 583583 is 5+8+3=165 + 8 + 3 = 16.
Divisibility by 3: The Digit-Sum Test

Here is the rule: a whole number is divisible by 3 if and only if the sum of its digits is divisible by 3.

The process has two stages. First, compute the digit sum. Then, check whether that sum is divisible by 33. Let's walk through a few examples:

NumberDigit SumDigit Sum ÷ 3Divisible by 3?
1231+2+3=61+2+3=66÷3=26 \div 3 = 2
Divisibility by 9: A Stricter Version

The rule for 99 follows exactly the same pattern but with a higher bar: a whole number is divisible by 9 if and only if the sum of its digits is divisible by 9.

Let's revisit the same numbers and test for 99:

NumberDigit SumDigit Sum ÷ 9Divisible by 9?
123666÷9=06 \div 9 = 0 R
How the Two Rules Relate

Since 99 is itself a multiple of 33, the test for 99 is simply a tighter version of the test for 33. When you check a number against both rules, there are exactly three possible outcomes:

  1. Divisible by both 3 and 9 — the digit sum is divisible by 99 (which guarantees divisibility by 33 too). Example: .
Why the Digit-Sum Rule Works

Understanding why a shortcut works keeps it from feeling like mere memorization, and once again the answer lives in place value. Consider a three-digit number written in expanded form:

number=a×100+b×10+c\text{number} = a \times 100 + b \times 10 + c

We can rewrite each power of 1010 using the fact that and :

Digit-Sum Test on a Real-World Number

Let's put the full process together with a practical scenario. Suppose a warehouse receives a shipment of 7,938 items, and you need to know whether they can be packed evenly into crates of 33 or crates of 99 with nothing left over.

Step 1 — Compute the digit sum.

7+9+3+8=277 + 9 + 3 + 8 = 27
Quick-Reference Table

Here is a compact summary to keep alongside the last-digit rules from our first lesson:

DivisorRuleExample: 432 (4+3+2=94+3+2=9)Example: 520 (5+2+0=75+2+0=7)
Conclusion and Next Steps

In this lesson, you learned that divisibility by 3 and 9 can both be tested by computing the digit sum of a number. If that sum is divisible by 33, the number is divisible by 33; if the sum is divisible by 99, the number is divisible by 99 (and by 33 as well). The reason this works is that each power of 1010 is just one more than a multiple of , so the leftover from every digit collects into the digit sum. These two rules now join the last-digit tests for , , and in your growing toolkit of divisibility shortcuts.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal