casting out nines
Casting out nines is a method for checking arithmetic that uses the idea of the digital root of a number. Let the digital root of a number n be r (n); for example, r (7586) = 8. For any two numbers a and b: r (a + b) = r (r (a) + r (b)) and r (a × b) = r (r (a) × r (b)). These rules allow checks on addition and multiplication as the following examples show. Does 7586 + 9492 = 16978? r (r (7586) + r (9492)) = r (8 + 6) = 5; r (16978) = 4; so the sum given is incorrect. Does 7586 × 9492 = 72006312. r (r (7586) × r (9492)) = r (8 × 6) = r (48) = 3; r (72006312) = r (21) = 3; which suggests that the product given is likely to be correct.
The name "casting out nines" comes from the fact that 9's need not be included in the calculation of the digital roots, since they have no effect on the final result. This a direct outcome of the fact that we use a decimal number system. If we calculated instead in octal (base 8), say, then the process would be one of "casting out sevens." This kind of checking will pick up most errors, but not all. For example, an interchange of two digits will not be detected, nor will replacing a 9 by a 0 or vice versa. The method appears in the work of Arab mathematicians, in the ninth century, and may have originated earlier with the Greeks and, possibly, the Hindus.