Divisibility and simple osculators

Continuing the discussion from Mental Multiplication: Useful Facts and Exercises: where in the end it was suggested to find a general algorithm for testing divisibility of numbers.

First of all, you just need to check the divisibility by primes. For a number like 6 you can then simply check if it is both: divisible by 2 and divisible by 3. Ignoring 2 and 5 for just a minute, primes end in either: 1, 3, 7, or 9.

We’ll do something similar to what is described here. For any number ending in 9, you just take the tenth digit plus one; so let’s start with 19 which will then be 2.

Check if 2774 is divisible by 19

Take the last digit, multiply by 2, and add it to the rest of the digits. Rinse and repeat:

  • 277+{\color{red}{4}}*2 = 28{\color{green}{5}}
  • 28+{\color{green}{5}}*2 = 3{\color{blue}{8}}
  • 3+{\color{blue}{8}}*2 = 1{\color{maroon}{9}}
  • 1+{\color{maroon}{9}}*2 = 1{\color{gray}{9}}

We come out at 19 and thus 2774 is in fact divisible by 19. Stop when you like though. If you know that 38 is twice 19, don’t even bother making it to 19. Also, the last line is only there to show that it’ll now remain 19.

Check if 2436 is divisible by 29

Take the last digit, multiply by 3, and add it to the rest of the digits. Rinse and repeat:

  • 243+{\color{red}{6}}*3 = 26{\color{green}{1}}
  • 26+{\color{green}{1}}*3 = 2{\color{blue}{9}}
  • 2+{\color{blue}{9}}*3 = 2{\color{maroon}{9}}

We come out at 29 and thus 2436 is in fact divisible by 29. You can try yourself for 39 (4), 49 (5), 59 (6), etc. Also note that for 9, we’d be multiplying by 1 and hence the abbreviated common rule of adding all the digits to see if it’s a multiple of nine.

Numbers not ending in 9

\frac{1}{11}=\frac{9}{99} \to \color{blue}10
\frac{1}{13}=\frac{3}{39} \to \color{blue}4
\frac{1}{17}=\frac{7}{119} \to \color{blue}12

Basically, you just make them end in 9 by taking a multiple that ends in 9. :wink: So to check if some number is divisible by 13, you’d do the same as above but multiply by 4. If you want to check for 23 then 23x3=69 and you use 7 instead.

The negative osculator

11 and 17 above come out pretty big, so we’ll make use of the fact that just like being one under with 19, we are one over with 11 and can use 1. Similarly, we can use 17x3=51 and use 5 to check for divisibility by 17. All we have to do now is subtract instead of add.

Check if 2583 is divisible by 21

Take the last digit, multiply by 2, and subtract it from the rest of the digits. Rinse and repeat:

  • 258-{\color{red}{3}}*2 = 25{\color{green}{2}}
  • 25-{\color{green}{2}}*2 = 2{\color{blue}{1}}
  • 2-{\color{blue}{1}}*2 = 0

Obviously, you can stop at 21 already, but the last line is there to show that it’ll always stay 0 now.

In conclusion

When the number ab ends in 9, drop b and use a+1 with addition. If the number ab ends in 1, drop b and use a with subtraction.

  • Numbers ending in 3 follow the logic for numbers ending in 9 when multiplied by 3.
  • Numbers ending in 7 follow the logic for numbers ending in 1 when multiplied by 3.

Add 2 and 5 back to the mix and you’re good to go. Numbers divisible by 10 are divisible by 5 and end in 0 or 5 but also divisible by 2, so they have to be even and cannot end in 5. Same logic for other compounds as well… 39 is both 3 and 13, but repeatedly adding the last digit times 4 might turn out faster.

The problem with the wiki link that @RobertFontaine had given in the post liked here at the top, is that you can usually drop something for simplicity. Granted these simplifications make things faster… imagine successively adding the last digit times 1 in case of divisibility of 3 or 9 instead of just adding them up; which obviously accomplishes the same.

Problem is that nobody knows anymore why divisibility by 7 could be checked by either adding the last digit times 5 successively or subtracting the last digit times 2 successively. Hope this post makes it clear that 7*7=49 \to 5 or 7*3=21 \to 2 are equally valid for use with addition or subtraction, respectively.

Lastly, note that the positive (5) and negative (2) osculator above add to the denominator (7). So if you got one osculator determined, you can get the second one by simply subtracting from the denominator.


Excellent post, Björn!

Thanks @Kinma,

but I doubt that anybody will benefit greatly from this post… can’t see the forest for the trees and all. :frowning: I had a quick look on YouTube and Numberphile which gets quoted a lot on this forum had this to say:

"7s are hard… 7s are notoriously hard" and tells a pseudo-savant story afterwards who can go to about 5 digits. Keep in mind the algorithm is 2 times last digit subtracted from what’s on the left. Just do that a couple of times and see if it’s a multiple of 7.

The guy is a math professor for crying out loud and look at the mistakes he makes throughout the video… almost justifying people having no clue, since he doesn’t either… and what’s with using two algorithms for 7… like the second one wouldn’t work in the first place!?!

Comment section reads:

“Me, math teacher who knows 7 divisibly… I tell students “ask, is hard” …nobody ever asks”
“Me, student… yeah, can do 7… everybody else dumb”

Also, no mention of negative osculators… he’s just going straight for 9 even with numbers ending in 1 and 7. No idea of the concept at all… oh yeah, this is a “general” approach… me needs to proof, very hard for common folks… don’t try.

I tend to follow mathologer although he is more of a geometer than an algebraist. Numberphile is more of a business / entertainment than a focus on number theory. Good videos from them are infrequent.

Math and physics videos without actual math or physics in them tend to be the norm. I watched a 90 minute Penrose lecture on Twistor theory last night and and it sounded really compelling except for a complete lack of math or physics.

I know these are targetted at people like me that arent mathematicians or physicists but sometimes it would be nice to be told the truth instead of a parable even if I do have to go away and think about it for a few years.