Saturday, November 17, 2001

Brent explained on Tuesday how to easily tell if a number is divisible by six. There's a good way to tell also, if a number is divisible by nine: Add all the digits up, and if the sum of the digits is divisible by nine, then the number is divisible by nine too. So if you have a very large number, like 891,245? Is it divisible by nine?

  • Is 891,245 divisible by 9?
  • 8+9+1+2+4+5 = 29
  • Is 29 divisible by 9? Nope, so:
  • 891,245 is not divisible by 9.

    But what if you have a really big number? Well here's a cool trick: You can get recursive. If the sum of the digits is too big to figure out in your head if it's divisible by nine, you can add the sum of the digits of the sum of the digits, and see whether that's divisible by nine. Here's an example::

  • Is 578,459,126,354,851,649,325,124,878,990,003 divisible by 9?
  • Sum of digits: 153
    I don't know off the top of my head if 153 is divisible by 9, so I'll sum the digits again:
  • 1+5+3 = 9
  • Is 9 divisible by 9? Of course it is, so:
  • 578,459,126,354,851,649,325,124,878,990,003 is divisible by 9.

    Guess what — it works for 3 too. Oh, and by the way, 153 divided by 9 is 17.