“Casting out nines” is an historic error-checking method. For addition, it works something like this:
1573 + 5862 = 7435
Add up the digits of each number; repeat until just one digit is left:
1 + 5 + 7 + 3 = 16; 1 + 6 = 7
5 + 8 + 6 + 2 = 21; 2 + 1 = 3
7 and 3 are your check digits
Add up the check digits:
7 + 3 = 10
Add up the digits of the sum as before:
1 + 0 = 1
This is your check result
Now add up the digits of the original sum, repeating as before
7 + 4 + 3 + 5 = 19; 1 + 9 = 10; 1 + 0 = 1
This result (1) is the same as the check result, so the answer 7435 is probably correct.
The process of adding up digits is the same as dividing by 9 to get the remainder until one digit is left, except that a result of 9 by adding up digits is equivalent to a result of 0 when dividing.
1573 / 9 = 174, remainder 7
5862 / 9 = 651, remainder 3
7435 / 9 = 826, remainder 1
It also works for multiplication:
23 * 47 = 1081
First check digit: 2 + 3 = 5
Second check digit: 4 + 7 = 11; 1 + 1 = 2
Multiply and get the check result: 5 * 2 = 10; 1 + 0 = 1
Compare to the result: 1 + 0 + 8 + 1 = 10; 1 + 0 = 1
It can be made to work with subtraction, but may give a negative result; in that case, add 9:
67 - 32 = 35
First check digit: 6 + 7 = 13; 1 + 3 = 4
Second check digit: 3 + 2 = 5
Subtract and get the check result: 4 - 5 = -1
Add 9 to make it positive: -1 + 9 = 8
Compare to the result: 3 + 5 = 8
For many years, this was taught to all students, but, as calculating machines became more common (calculating machines, as opposed to computers, started being mass produced in Victorian days), it became less used, until, by the time I was in school, it was filed under “quaint and curious”—something to amuse the brighter kids with if they had extra time.