INTERLUDE: Remainder arithmetic
See also the article Modular Arithmetic.
What is the final digit of 34×57?
Without doing the full multiplication, we know it must be 8, because 8 is the final digit of 4×7.
But how do we know?
Because 34×57=(30×57)+(4×57)=m10+(4×50)+(4×7)=m10+200+8=m10+8.
In this example 'final digit' means 'remainder when divided by 10'. To find the remainder in the product (of 34 and 57), we need only find the product of the remainders (4 and 7). This rule works, for essentially the same reason, for remainders when we divide by numbers other than 10.
Once upon a time, schoolchildren were taught a special case of this, called 'casting out nines'. Suppose, for example, I work out 256×77 by long multiplication, and I get the answer 19612. The remainders when I divide 256 and 77 by 9 are their digital roots: 4 and 5 respectively. The product of 4 and 5 is 20, with digital root (remainder) 2. My answer 19612 should also have a digital root of 2; in fact it has a digital root of 1, so I must have made a mistake in my long multiplication!
Beware: casting out nines may detect a wrong answer (like that above) but it cannot guarantee a correct one. For example, 19721 has digital root 2, but the 'final digit test' (which could be called 'casting out tens') shows that it cannot be the answer to 256×77.
[Attending to remainders is the essence of 'modular arithmetic'. The genius C F Gauss gave the first formal account of this in his 1801 book Disquitiones Arithmeticae, which he published at the age of 24].
Multiples of 7
A test for divisibility by 7 (or any number, in principle) can be devised using remainder arithmetic, as follows. The remainder when 10 is divided by 7 is 3, so the remainder when 100 (=10×10) is divided by 7 is 3×3=9 (which is 7+2, so the actual remainder is 2).
[Editor's note: