News for hackers. Stuff that matters.
Re:Divisibility by 7 by jackowayed on Saturday October 30, 2010 @11:32PM (#1852415)
I know:

* 2 - if it ends in 0,2,4,6,8, it's divisible by 2

* 3 - if the sum of the digits is divisible by 3, so is the number

* 4 - Ignore everything but the last 2 digits. If the last 2 digits make a number that's divisible by 4, the whole number is (eg. anything ending in 52 is divisible by 4 because 52 is divisible by 4)

* 5 - If it ends in 0 or 5, it's divisible by 5.

* 6 - do an and of the 2 and 3 tests.

* 8 - Same as the 4 test, only last 3 digits.

* 9 - same as 3, only the digit sum needs to be divisible by 9 instead of 3

* 10 - If it ends in 0, it's divisible by 10.

So I guess the only one I don't know is 11.

Re:Divisibility by 7 by skmurphy on Sunday October 31, 2010 @12:25AM (#1852478)
11 = add the first, third, fifth, etc.. digits, if the sum matches that for the second, fourth, sixth, etc.. then the number is divisible by 11.
Re:Divisibility by 7 by TheNewAndy on Sunday October 31, 2010 @01:48AM (#1852575)
Not quite:

5060 is an exception to your rule.

As described before, if (even digit sum) - (odd digit sum) is divisible by 11, then the number is divisible by 11.

Re:Divisibility by 7 by skmurphy on Sunday October 31, 2010 @01:59AM (#1852594)
If you are not careful you will learn something new. Thanks for the tip.