mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.8K
active users

Mark Dominus

Interesting thought this morning. It started with: is 509 prime? So I started doing trial division. Dividing by 13 I found 509=1330+119 and 119 is not a multiple of 13, okay.

Now moving on to 17, I can quit immediately *without* dividing because I just saw that 509=1330+119 and 119 *is* a multiple of 17.

Another handy trick is, when checking if 509 is a multiple of 19, you do *not* start by dividing 509 by 19 getting 380 plus some yucky remainder. Instead you observe that 509 = 19 + 490 and 49 is not a multiple of 19 so you move on.

I only thought of this embarrassingly late in life.

An elaboration on this is that when factoring smallish numbers of the form n=10k+1 you will often need to test for divisibility by 7 and then by 13 in succession. But 713=91 so instead of considering n, consider 𝑛91=10k90=10(k9) and do both at once.

For example, instead of dividing 5031 by 7 and then by 13, consider 5039=494 instead. This is evidently not divisible by 7, but for 13 you can see from 494+26=520 that it is a multiple of 13, and therefore so too was 5031.

I'm talking about mental calculation here, or maybe abacus. For computer calculation it's obviously stupid.

The overarching trick here is (a) "short division" and (b) short division is usually taught left to right, but it works just as well right to left and you should use the one that seems easier.

To do 5486÷13 it's easiest to go left to right: 548628626 aha we are done.

But to do 4726÷13 it's much easier to to right to left 47264739 aha we are done.

My kids' schools never taught them short division, which seems to me a sad and odd omission.

The idea is that instead of doing the big hairy thing on the left you do the compact speedy thing on the right. The left-side technique should only be used when the divisor is bigger than the multiplication tables you have memorized.

The thing on the right is simple enough to do in your head, and particularly so if you only need the remainder and not the quotient. My kids were often mystified by my ability to divide in my head but it's just that I was taught a better algorithm than they were.

I blogged about this a while back as part of a longer article about several methods of checking for divisibility by 7: blog.plover.com/math/divisibil

@mjd Alternatively, 1001 is (7)(11)(13), so 5031 is (031-5)=26 (mod 1001), so it's a multiple of 13.

@icecolbeveridge I really need to start doing this, thanks.

@mjd ~~there's [edit: was, now fixed] some mistake in the image on the right -- it starts 1764... Instead of 1763...~~

@svat Yes, for 6 years I have been too lazy to correct the picture, because the article is about divisibility testing, and the wrong quotient doesn't affect that.

@mjd It's not just about the quotient — I had never encountered the term "short division" before (we were only taught "division" which is closer to the picture on the left, but in practice I was doing something more or less like the picture on the right) so I was trying to understand "short division" using the picture, so I didn't understand how you got the 4 or the final 9 in the quotient, or even the remainder of 9 instead of 2 (which is equivalent yes but it was confusing). Now I understand what was intended though :)

@svat Yes, I really should fix it, it detracts from the article.

@svat Fixed, thanks for the nudge.

@mjd in the UK pupils call this the "bus stop" method and is the one they learn these days. None of my pupils know anything about long division. They see it for the first time when we teach them polynomial division, and they find it really hard.

@mjd Sorry, could you explain what you mean? I'm not sure if you're saying 509 is or isn't a multiple of 17 (I know it isn't, is the logic "it can't be because 390 isn't"?)

@icecolbeveridge Sorry, I answered the wrong question before.

My trial division by 13 has revealed that 509=1330+119. I know that 119 is a multiple of 17 and that 1330 isn't, so their sum can't be.

I know that 119 is a multiple of 17 because I happen to remember that 119=717. And obviously 17 can't divide 1330 because it would have to divide 13 or 30.

@mjd ok, good, we're on the same page :-)

@mjd Since 509 mod 4=1, you can check if it's the sum of two squares in one and only one way and then check to see if the two squares are relatively prime.

@jhertzli I don't understand how that helps. Please elaborate.