---
tag: 0E7W0EM6J6
kind: concept
name: Casting out nines
msc: [11A63]
sources:
  - url: https://en.wikipedia.org/wiki/Casting_out_nines
    locator: Checking calculations by casting out nines
same_as:
  wikidata: Q1757155
  wikipedia: Casting out nines
---

## Summary

Casting out nines is a method to check a computation with integers by the remainders modulo $9$.
It uses the fact that a natural number is [[congruent|0TPW25CBN6]] modulo $9$ to the sum of its decimal digits.
To check $a \cdot b = c$, one compares the digit sum of $c$ with the product of the digit sums of $a$ and $b$, all modulo $9$. The same works for sums and differences.

## Remarks

If the two results are not congruent modulo $9$, the computation is wrong. If they are congruent, the computation can still be wrong. For example, an exchange of two digits in the result is not detected.
The method works because of [[divisibility by 9|0ESHD7ZQDX]] and the compatibility of congruences with [[addition|00FWBN7F0Y]] and [[multiplication|072D5G4SK6]].

## Explanations

### L1 human

Check $46 \cdot 37 = 1702$. The digit sums are $10 \equiv 1$ and $10 \equiv 1$, so the product should be $1 \cdot 1 = 1$ modulo $9$.
The digit sum of $1702$ is $10 \equiv 1$, so the check passes.
A wrong result such as $1712$ has the digit sum $11 \equiv 2$, so the check finds the error.
