Casting Out Nines to Check Arithmetic

A digit sum keeps the same remainder.

Powers of ten and the number 9

Casting out nines is a quick check on addition and multiplication. It rests on one fact about the powers of ten.

Each power of ten is a run of nines plus 1: 10 = 9 + 1, 100 = 99 + 1 and 1000 = 999 + 1. Every run of nines is a multiple of 9, because 9 = 9 × 1, 99 = 9 × 11 and 999 = 9 × 111. So each power of ten leaves remainder 1 when it is divided by 9. In the language of modular arithmetic, 10 mod 9 = 1, 100 mod 9 = 1 and 1000 mod 9 = 1.

101001000is9 + 199 + 1999 + 1mod 9111

Each power of ten is a multiple of 9 plus 1, so each one leaves remainder 1 when it is divided by 9.

A number and its digit sum

Take 473. By place value it is 4 hundreds, 7 tens and 3 ones: 473 = 4 × 100 + 7 × 10 + 3. Split each hundred into 99 + 1 and each ten into 9 + 1: 473 = (4 × 99 + 7 × 9) + (4 + 7 + 3).

The first bracket is 396 + 63 = 459 = 9 × 51, a multiple of 9, so it leaves no remainder. Whatever remainder 473 leaves comes from the second bracket, which is the sum of its digits: 4 + 7 + 3 = 14.

14 = 9 + 5, so 14 leaves remainder 5, and so does 473. Dividing checks it: 473 = 9 × 52 + 5. A number and the sum of its digits always leave the same remainder when they are divided by 9.

100100100100hundreds10101010101010tens111ones—473 = 100 × 4 + 10 × 7 + 3unbundle: 100 = 99 + 1, 10 = 9 + 1

473 = 100a + 10b + c: every hundred is 99 + 1 and every ten is 9 + 1, so unbundle them and see what 9 cannot swallow

Make 342 and unbundle it

The blocks show 473. Unbundle them: each hundred splits into 99 and 1, each ten into 9 and 1, and the 99s and 9s go into the box, where 9 divides them exactly. The 14 loose units are the digit sum. Then make 342: its digits add to 9, so 342 divides by 9 exactly.

Keep adding the digits

The digit sum can be reduced again. 14 has the digits 1 and 4, and 1 + 4 = 5. Adding digits until one digit is left gives the digital root: the digital root of 473 is 5.

The digital root is the remainder on dividing by 9, with one exception. A digital root of 9 means remainder 0: 342 has the digit sum 3 + 4 + 2 = 9, and 342 = 9 × 38.

The name comes from a shortcut. Any 9, and any group of digits that adds to 9, can be crossed out, or cast out, before adding, because it does not change the remainder. In 8,976, cast out the 9 and add the rest: 8 + 7 + 6 = 21, and 2 + 1 = 3. Dividing agrees: 8,976 = 9 × 997 + 3.

Checking a sum

Check 473 + 218 = 691. Find the remainder of each number from its digits. 473 has the digit sum 14, which leaves 5. 218 has the digit sum 2 + 1 + 8 = 11, which leaves 2. 691 has the digit sum 6 + 9 + 1 = 16, which leaves 7.

The remainders of the two numbers being added are 5 and 2, and 5 + 2 = 7. The answer leaves 7 as well, so the sum passes the check.

Here is why the remainders must add. 473 = 9 × 52 + 5 and 218 = 9 × 24 + 2, so 473 + 218 = 9 × 76 + 7. The multiples of 9 add to a multiple of 9, and the remainders add to 7. If the remainders add to 9 or more, reduce once more: remainders of 6 and 8 add to 14, and 14 leaves 5.

473leaves 5+218leaves 2691leaves 7

473 + 218 = 691. The digit sums 14, 11 and 16 give the remainders 5, 2 and 7 on dividing by 9, and 5 + 2 = 7, so the answer passes the check.

What the check can and cannot catch

Suppose the answer had been written as 681. Its digit sum is 6 + 8 + 1 = 15, which leaves 6, not 7. So 681 is certainly wrong.

Passing the check does not prove that an answer is right. Suppose the digits of 691 had been written in a different order, as 961. The digit sum is still 16, which leaves 7, so 961 passes, but it is wrong. It is 270 too big, and 270 = 9 × 30. Casting out nines cannot see an error that is a multiple of 9, and changing the order of the digits always makes an error of that kind, because the digit sum does not change.

Checking a product

The same check works for multiplication, with one change: the remainders are multiplied. Say one number is 9p + r and the other is 9q + s, where r and s are their remainders. Expand the brackets: (9p + r)(9q + s) = 81pq + 9ps + 9qr + rs = 9(9pq + ps + qr) + rs. Everything except rs is a multiple of 9, so the product leaves the same remainder as r × s.

Check 23 × 14 = 322. The digit sums give remainders of 2 + 3 = 5 and 1 + 4 = 5. Multiply them: 5 × 5 = 25, and 2 + 5 = 7. The answer 322 has the digit sum 3 + 2 + 2 = 7, which agrees.

Worked example: A Multiplication Checked by Casting Out Nines, and a Copying Error

Question A stock clerk must work out 347 × 286 by hand. Two answers are offered, 99242 and 99142. (a) Use casting out nines to show that one of the two answers is wrong, and say which. (b) The clerk copies the other answer into the ledger as 92942, with two digits changed places. Does casting out nines catch this error? Give the reason.

  1. 1.Reduce each factor to its digital root. For 347: 3 + 4 + 7 = 14 and 1 + 4 = 5. For 286: 2 + 8 + 6 = 16 and 1 + 6 = 7.

    3471453 + 4 + 7 = 142861672 + 8 + 6 = 16
    3471453 + 4 + 7 = 142861672 + 8 + 6 = 16
    Add the digits until one digit is left: 347 gives 14 and then 5, and 286 gives 16 and then 7.
  2. 2.Multiply the digital roots and reduce again: 5 × 7 = 35 and 3 + 5 = 8. The correct product must have a digital root of 8.

    3471453 + 4 + 7 = 142861672 + 8 + 6 = 165 × 7 = 358the product has root 8
    3471453 + 4 + 7 = 142861672 + 8 + 6 = 165 × 7 = 358the product has root 8
    Multiply the digital roots: 5 × 7 = 35, and 3 + 5 = 8. The product must have a digital root of 8.
  3. 3.(a) For 99242: 9 + 9 + 2 + 4 + 2 = 26 and 2 + 6 = 8, which agrees. For 99142: 9 + 9 + 1 + 4 + 2 = 25 and 2 + 5 = 7, which does not agree. So 99142 is wrong.

    roots: 5 × 7 = 35, and 3 + 5 = 899242268agrees99142257wrong ✗
    roots: 5 × 7 = 35, and 3 + 5 = 899242268agrees99142257wrong ✗
    (a) 99242 has the digital root 8 and 99142 has the digital root 7, so 99142 is wrong.
  4. 4.The number 92942 has the same digits as 99242 in a different order. Its digit sum is still 9 + 2 + 9 + 4 + 2 = 26, and its digital root is still 8. It passes the check, although it is not the product.

    roots: 5 × 7 = 35, and 3 + 5 = 899242268agrees99142257wrong ✗92942268passes
    roots: 5 × 7 = 35, and 3 + 5 = 899242268agrees99142257wrong ✗92942268passes
    92942 has the same digits as 99242, so its digit sum is still 26 and it passes the check.
  5. 5.(b) No. Changing the places of two digits does not change the digit sum, so the digital root stays 8. The error is 99242 − 92942 = 6300 = 9 × 700, a multiple of 9, and casting out nines cannot see an error that is a multiple of 9.

    roots: 5 × 7 = 35, and 3 + 5 = 899242268agrees99142257wrong ✗92942268passesthe same digits, so the same digit sum: 2699242 − 92942 = 6300 = 9 × 700
    roots: 5 × 7 = 35, and 3 + 5 = 899242268agrees99142257wrong ✗92942268passesthe same digits, so the same digit sum: 2699242 − 92942 = 6300 = 9 × 700
    (b) The error is 6300 = 9 × 700, a multiple of 9, which casting out nines cannot see.

Answer: (a) 99142 is wrong: its digital root is 7, and the product must have a digital root of 8; (b) no: 92942 still has the digit sum 26 and the digital root 8, because changing the places of two digits does not change the digit sum

Common mistakes

  • Saying that 99242 has been proved correct because its digital root agrees. Agreement shows only that the answer is not wrong by an amount that casting out nines can see. An answer that fails the check is certainly wrong, but an answer that passes may still be wrong.
  • Adding the digital roots, 5 + 7 = 12, when the numbers are multiplied. The digital roots are combined by the same operation as the numbers, so for a product they are multiplied: 5 × 7 = 35.

More number theory problems, worked step by step →

The usual mistakes

Treating the digit sum as the remainder. The digit sum of 473 is 14, but a remainder on dividing by 9 is at most 8. Reduce again: 1 + 4 = 5.

Adding the remainders for a product. For 23 × 14 the remainders are multiplied, 5 × 5 = 25, which leaves 7. Adding them gives 10, which leaves 1, and would wrongly reject the correct answer 322.

Taking a pass as proof. An answer that fails the check is wrong. An answer that passes may still be wrong by a multiple of 9.

Practice Casting Out Nines to Check Arithmetic in the app