Mathematics

Good day everyone.
A simple idea, it’s possible to look at positive whole integers and work out their primes for several numbers, example: 1331, is divisible by 11, add altenate digits 1 and 3 and 1 and 3 if they are identical or the sum is divisible by 11 then the original is divisible by 11.
2’s are easy, is the last digit even, similar with 5’s, ( 0 or 5).
So I remember a ‘rule of 7’s’ in other words a way of looking at an integer and discovering if it’s directly divisible by 7, sadly age and extraneous brain fluff have pushed out this proof. Anyone remember?
Peter

They aren’t as simple as the other examples you listed, but there are a number of ways. Wikipedia’s entry.

Here’s the Wikipedia page on divisibility tests. There are plenty of others out there on the web:

I don’t complain about your asking something that’s easily looked up on the internet – it’s often not clear what to type into your search engine.
But you really should try to be a bit more specific in your thread title. “Mathemsatics” covers a helluva lot of ground.

Wikipedia: Trying it’s damnedest to put QG out of business since 2000. :slight_smile:

It’s taking longer than we thought.

It’s not doing a good enough job.

I just read that, and I think a simpler rule to those is “to determine if a number is divisible by 7, divide the number by 7 and see.” It has been my belief that there is no simple rule for determining if a number is divisible by 7. I maintain that belief.

He must have meant Questions Général, a forum on le Dopé Droit.

The “Add digits in such and such a fashion…”-type rule for checking decimal numbers for divisibility by 7 is this: split the numbers digits into triplets, from right to left. For each triplet ABC, compute the value (2 x A + 3 x B + C) mod 7. Alternately add and subtract these remainders, from right to left. The result is the original number’s remainder mod 7.

Actually, let me rephrase that more modularly:

The “Add digits in such and such a fashion…”-type rule for checking decimal numbers for divisibility by 7 is this: split the number’s digits into triplets, from right to left. Alternately add and subtract the triplets, mod 7, from right to left. The result is the original number mod 7.

If one wants further help: As for how to handle a particular triplet ABC, its value mod 7 is the same as that of 2 x A + 3 x B + C.

If one wants further help: As for how to handle a particular digit, remember that mod 7 we may treat 7 as 0, 8 as 1, 9 as 2, 6 as -1, etc. The decimal digits can be taken to go from -3 to 3.

Putting all these together, it’s not that bad. Indeed, even ignoring the further help and just doing the first bit, it’s not that bad.

It may be slightly easier for human calculation, but I think that the most practical algorithm is just to divide by 7 and see what the remainder is. With decimal notation, there are only a few prime numbers with easy algorithms: 2, 3, 5, 11 and 37. (37 has one because 111=37*3.)

The divisibility test for 37 (split into triplets, add mod 37) isn’t so very different from that for 7; 7 just has the alternation between addition and subtraction.

If you’re going to mod it, isn’t that already a divisibility test? You might as well go mod(number,7) and see if it’s 0.

Modding 3 digit numbers in order to mod arbitrary digit numbers. Just like the test for divisibility by 3 is “Add up the digits, mod 3”.

(Also, FWIW, when I say “add mod X”, I don’t necessarily mean you have to reduce to remainders right now. I just mean you can replace anything by anything it is equivalent to mod X as you go along, as frequently or as rarely as you like. In practice, it is often convenient to reduce everything to remainders as early as possible (why deal with additions of increasingly large numbers?), but it’s up to you.)

Take the ones digit, double it and subtract that from the portion of the number excluding the ones digit. Repeat until you get a number obviously divisible by 7 or obviously not divisible by 7 (you can ignore signs).

Example: Is 1253 divisible by 7? The ones digit is 3 - so we double that and subtract 6 from 125 to get 119. The ones digit of that number is 9, so we double that and subtract 18 from 11 - and get -7, which is obviously divisible by 7, meaning that 1253 is divisible by 7 (1253 is 179*7).

That’s the simplest method I know of, and it’s pretty quick. You can determine that 98765 is not divisible by 7 in a few moments, by subtracting 10 from 9876 to get 9866, subtract 12 from 986 to get 974, subtract 8 from 97 to get 89, and subtract 18 from 8 to get -10 which is obviously not divisible by 7. If anyone is curious I can explain why this works.

It works because 10x + y is divisible by 7 just in case x - 2y is divisible by 7.

Why is that? Because 10x + y = 7(3(x - 2y)/7 + x + y), and, conversely, x - 2y = 7(-2(10x + y)/7 + 3x). So if either one divided by 7 is an integer, the other is also 7 times an integer.

Eh, for aesthetic symmetry, I should have written that as (10x + y)/7 = 3(x - 2y)/7 + x + y and (x - 2y)/7 = -2(10x + y)/7 + 3x.

(Also, sorry I stole your thunder, Andy L.)

I would phrase the reason as “you’re subtracting off a multiple of 21, and then dividing by ten”.

That’s a much nicer way to put it, yes. [With, of course, the understanding that the division by 10 won’t undo divisibility by 7 on the grounds that 10 and 7 are coprime]