Quick - is 91 prime?
balltech.blogspot.com
balltech.blogspot.com
Starting from the left add every other digit => n1, Starting with the second digit add every other digit => n2
if n1 - n2 == 0 or if n1 - n2 is divisible by 11 then the number is divisible by 11. Example
13574
1 + 5 + 4 = 10
3 + 7 = 10
Since 10 - 10 == 0, the number is divisible by 11.
Even cooler example 155357548018579643
1 + 5 + 5 + 5 + 8 + 1 + 5 + 9 + 4 = 43
5 + 3 + 7 + 4 + 0 + 8 + 7 + 6 + 3 = 43
43 - 43 == 0, also divisible by 11
aka
if n1 = n2 (mod 11)
Cool trick.
Here's some more fun: http://www.jgc.org/blog/2008/02/sum-of-first-n-odd-numbers-i...
there's also another trick for 11 that comes from addition. 1234 * 11 = 12340 + 1234 = 13574 (or, by digit: 1 (1+2) (2+3) (3+4) 4). that makes 3 digit multiples easy to detect. for instance, 484: 8 is clearly 4+4, so it's divisible by 11 (440 + 44).
it's slightly more tedious for >3 digit numbers. for instance, 1353: from left to right: 3 = 1 + ..2, 5 = 2 + ..3. 3 == 3, so it'd divisible by 11. i guess i explained this somewhat poorly, sorry for that.
it's also somewhat harder if you have carries.
Seven wasn't new to me, but I've never been able to remember it. Maybe I will this time.
http://www.spaceandgames.com/?p=27
Now how certain are you that 51 is prime?
for example, here's a quicker way for 1353 than what staticshock posted. 1353 - 1100 = 253. and 253 - 220 = 33. And clearly 11 divides 33, so 11 divides 1353.
modular arithmetic ftw!
you want to know if 8765 is divisible by 7. take the one's digit and multiply by 21. this gets a number that is divisible by 7 so you can subtract it. this will clear the last digit because we're subtracting this:
last digit * 1 + last digit * 20.
now we have a number that ends in a zero. in this case: 8660
now divide by 10. we can do that because that's dividing by 2 and 5 and that won't affect whether or not 7 can go into the number.
now we have a number to deal with that's at least one digit shorter. repeat until it's obvious if the remaining number divides by 7 or not.