4 ms·
My preferred way to test divisibility by 13: Take the number, cross off the one's digit, but multiply that digit by 9, and take the product and subtract it from
by drfuchs 6y ago
My preferred way to test divisibility by 13: Take the number, cross off the one's digit, but multiply that digit by 9, and take the product and subtract it from the modified original number. Repeat until you only have a digit or two, and what's left is a multiple of 13 iff the original number was.
Clearer as an example: Is 4173 divisible by 13? First iteration: 417 - (3 x 9) = 390. Second: 39 - (0 x 9) = 39. And 39 is divisible by 13, so 4173 is. (No worries if the last subtraction gives a negative result; same rule applies.)
To test for divisibility by 7, do exactly the same thing, but multiply the one's digit by 2 instead of 9. For 17, use 5. For 11, use 1.
I learned the divisible-by-7 trick from a book when I was a kid, but didn't figure out why it works, and how to generalize it, until I was embarrassingly adult. Left as an exercise for the reader.
- sverona 6y agoROT13: Xvyyvat gur ynfg qvtvg naq fhogenpgvat gjvpr gur ynfg qvtvg sebz jung'f yrsg vf whfg fhogenpgvat n zhygvcyr bs gjraglbar naq qvivqvat ol gra.
- drfuchs 6y agoWell said!
- dmurray 6y agoIt's obvious if you look at the version with 11 first. I find the alternating digit sum method is easier to use for 11. They're competely equivalent, but your method makes it seem like you need to remember more state. For example, to test 678101 for divisiblity by 11 you'd go "678101, 67809, 6771, 676, 61, nope". With the alternating digits method you go "1, 1, 2, -6, 1, -5, nope" only dealing with one-digit numbers at every step. Maybe with practice you learn to ignore the leading digits until you need them.
- eps 6y agoFor 11 the even faster method is to just do this: 678101 -> 6-7+8-1+0-1 = 5 -> no bueno 874632 -> 8-7+4-6+3-2 = 0 -> divides by 11 The exact same idea, but even less "state" needed as you put it.
- dmurray 6y agoThink you're doing the exact same as me but I started from the right. 1-0+1-7+8-6. This way you end up with the remainder mod 11, if you start from the left you sometimes need to flip the sign at the end.
- madcaptenor 6y agoWho wants to multiply by 9, though? The version of the 13 test I've seen has you multiply by 4 and add instead: 4173 -> 417 + (3 x 4) = 429 -> 42 + (9 x 4) = 78, which is divisible by 13, so 4173 is. Of course, these two tests work for the same reason. You're saying 10a + b is divisible by 13 iff a - 9b is, I'm saying 10a + b is divisible by 13 iff a + 4b is, and those differ by 13b.
- michaericalribo 6y agoBut multiplying by 9 is so easy! You can check you’re right if (a) the first digit of the result is 1 less than the number you started with, and (b) the digits sum to 9
- rmetzler 6y agoThat’s how I taught my daughter.
- vaccinator 6y agobut that only works up to 10.. my method works for any number, and you could adapt it for x11... see below
- alisonkisk 6y agoLucky for us, all digits are less than 10.
- vaccinator 6y agoWhat is 23 x 9 with that trick?
- cipherzero 6y agoJust going off the trick above would t it just be: 23 x 10 - 23 = 230 - 23 = 207... I guess I’m confused what point you’re making?