Casting Out Nines

Modular Mathematics, Casting Out Nines

Casting Out Nines

Without a calculator, quickly determine whether 12485240113 is divisible by 9.  Write this 11 digit number as a sum of individual digits times powers of ten.  When working mod nine, ten is the same as one.  Ten to any power is also the same as one.  So we can simply add up the digits and see if that is divisible by nine.  The result is 31, which is 4 more than 27, hence 4 mod 9.  Our original number is not divisible by 9.

This procedure is sometimes called "casting out nines", because nines can be discarded as you go.  They're always divisible by 9 anyways.

This works because we are using a base ten number system.  If you usually write your numbers in octal, i.e. base 8, you can tell very quickly whether a number is divisible by 7.  Add up the octal digits and see if the result is divisible by 7.

Since 3 goes into 9, you can add up the digits to determine whether a large number is divisible by 3.  Since 2 and 5 divide into 10, you only need consult the last digit to see if a number is divisible by 2 or 5, or 10.  Examine the last two digits to see if a number is divisible by 4, 20, 25, 50, or 100.