I am MegaDork, Who Thinks About Math for No Reason

When I was in junior high, 35 years ago (or so), I learned a rule for quickly determining if a number is divisible by 11: you alternately subtract and add the digits, and if that result is divisible by 11, so was the original number.

So 43945 is, because 4-3+9-4+5 = 11, which is divisible by 11.

870428 is not, because 8-7+0-4+2-8 = -9, which is not divisible by 11.

My daughter is learning how to divide polynomials in math right now, and it occurred to me that’s an easy way to prove this. Place value is really shorthand for a polynomial expression; for instance, 43945 means

410[sup]4[/sup] + 310[sup]3[/sup] + 910[sup]2[/sup] + 410[sup]1[/sup] + 5*10[sup]0[/sup].

So any number ABCDEF… is

A10[sup]n[/sup] + B10[sup]n-1[/sup] + C10[sup]n-2[/sup] + D10[sup]n-3[/sup] + E*10[sup]n-4[/sup] + …

11 is 10 + 1, so it’s like dividing a generalized polynomial expression by (X+1). X just happens to be 10 in our normal lives. Consider the number ABCDE… in some base, expressed as a polynomial.

First pass of long division by (X + 1), you get A*X[sup]n-1[/sup], leaving:

(B-A)X[sup]n-1[/sup] + CX[sup]n-2[/sup] + DX[sup]n-3[/sup] + EX[sup]n-4[/sup] + …

Second pass, you get A*X[sup]n-1[/sup] + (B-A)*X[sup]n-2[/sup], leaving:

(C-(B-A))X[sup]n-2[/sup] + DX[sup]n-3[/sup] + EX[sup]n-4[/sup] + … which is
(C- B+A )X[sup]n-2[/sup] + DX[sup]n-3[/sup] + E
X[sup]n-4[/sup] + …

Third pass:

(D- C+B-A )X[sup]n-3[/sup] + EX[sup]n-4[/sup] + …

Finally, you’ll get to the term that’s X[sup]n-n[/sup], or X[sup]0[/sup], otherwise known as the ones digit.

And you’ll be left with a remainder (suppose it was K digits long)

K-J+I-H+…-B+A.

Now if the *remainder *is divisible by 11, so was the original number, right? Duh.

But wait. K-J+I-H+…-B+A is exactly the *opposite *of the rule A-B+C-D+E-…

Yeah, but if a number is divisible by 11, so is (negative) that number.

So yeah, that proves the 11 rule. But it also means this rule works in any base! We just did it for the general X, not 10, specifically. In base 16, for instance, you could easily check if a number is divisible by 17 by alternately subtracting and adding the digits.

I realized a few years ago about the number 9 divisibility rule (just add the digits - we all know that one, right?), and it also holds for other bases. The digit one less than the base (the highest single digit number) always has that divisibility rule, but the ‘one more than the base’ being true across all bases had eluded me. And the rule for 9 is even more obvious now, because you could divide a polynomial expression by (x-1) and get a remainder of A+B+C+D+…

Why am I posting this here? This is the only place on the internet I could post it and not be (probably justifiably) ridiculed.

That’s a neat trick, but how often do you want to know if a number is evenly divisible by eleven?

You just don’t get it, do you, beowulff?</AustinPowers>

When I was in high school, I learned FORTRAN and wrote a program to find palindromic prime numbers. I made a large list of them, and quickly noted that there was a huge gap from whatever number came before 1000 up to whatever came after 9999. In short, there were no palindromic primes with 4 digits. Some with 3 digits and a bunch with 5 digits, but none with 4.

Playing with this a little more, I discovered that any palindromic number with an even number of digits must be divisible by 11. Thus, no such number can be prime (other than 11 itself).

@bup: Whatever you do, please *don’t *click this link: xkcd: Nerd Sniping

@everybody else: There; that’s got rid of him. :smiley:

Thanks for sharing! Math is awesome!

Why is that?

You triggered my OCD.

Three-digit numbers: If the first and third digits add to the second digit, the number is divisible by 11.

Ex: 693 — 6+3=9. 693 divided by 11 is 63.

If the first and third digits minus 11 is the second digit, the number is divisible by 11.

Ex: 737 — 7+7-11=3. 737 divided by 11 is 67.

Four-digit numbers: xxyy and *xyyx *are divisible by 11.

3388/11 = 308. 3883/11 = 353.

Three-digit numbers where all digits are the same are divisible by 37.

Ex: 555/37 = 15.

Four-digit numbers where the first two digits are double the second two digits are divisible by 67.

Ex: 4623/67 = 69.

142857 has the same digits in different orders when multiplied by the first 6 integers.

1 x 142857 = 142857
2 x 142857 = 285714
3 x 142857 = 428751
4 x 142857 = 571428
5 x 142857 = 714285
6 x 142857 = 857142
and
7 x 142857 = 999999

When you want to know the total volume of all your old-timey amplifiers!

Pretty trivial really.

As you say in the OP a 4-digit number ABCD is disable by 11 iff A-B+C-D is divisible by 11.

A 2-digit palindrome is always in the form AA which by your formula gives us A-A. Which always equals zero since each digit value is added once and subtracted once.

Zero is evenly divisible by 11. So all 2-digit palindromes are divisible by 11.

A 4-digit palindrome is always in the form ABBA which by your formula gives us A-B+B-A. Which always equals zero for the same reason.

A 6-digit palindrome is always in the form ABCCBA which by your formula gives us A-B+C-C+B-A. Which also always equals zero for the same reason.

A formal proof by induction comes pretty quickly from the simple reasoning by example just above.

Late add:
One could also make a parity argument:

In the sum-of-digits step all the even-placed digits have minus signs and all the odd-placed digits have plus signs. And by symmetry working from the center outwards, each digit will appear in both an odd and an even position. Each palindromic digit pair will hence sum to zero. The sum of any series of zeros is zero. QED.

The *any *provides the generality for palindromes of all even lengths.

867-5309

:smack: Thank you.

Yes, but what about post #5? :smiley:

Shhhh! He’s undisturbably busy proving Goldbach’s Conjecture just now. He’ll turn his attention to Post #5 when he’s done with that.