# I am MegaDork, Who Thinks About Math for No Reason

**URL:** https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374
**Category:** Miscellaneous and Personal Stuff I Must Share
**Created:** [November 23, 2015, 5:48pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374 "2015-11-23T17:48:20Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![bup](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bup](https://boards.straightdope.com/u/bup)
#### Post date: [November 23, 2015, 5:48pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/1 "2015-11-23T17:48:20Z")

</div>

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

4_10[sup]4[/sup] + 3_10[sup]3[/sup] + 9_10[sup]2[/sup] + 4_10[sup]1[/sup] + 5\*10[sup]0[/sup].

So any number ABCDEF… is

A_10[sup]n[/sup] + B_10[sup]n-1[/sup] + C_10[sup]n-2[/sup] + D_10[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] + C_X[sup]n-2[/sup] + D_X[sup]n-3[/sup] + E_X[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] + D_X[sup]n-3[/sup] + E_X[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] + E_X[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.

---

<div class="post-metadata">

### Author: ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)
#### Post date: [November 23, 2015, 5:51pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/2 "2015-11-23T17:51:58Z")

</div>

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

---

<div class="post-metadata">

### Author: ![bup](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bup](https://boards.straightdope.com/u/bup)
#### Post date: [November 23, 2015, 5:55pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/3 "2015-11-23T17:55:21Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)
#### Post date: [November 24, 2015, 7:22am UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/4 "2015-11-24T07:22:11Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)
#### Post date: [November 24, 2015, 3:47pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/5 "2015-11-24T15:47:37Z")

</div>

@ **bup** : Whatever you do, please \*don’t \*click this link: [xkcd: Nerd Sniping](http://xkcd.com/356/)

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

---

<div class="post-metadata">

### Author: ![F.Pu-du-he-pa-as](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@F.Pu-du-he-pa-as](https://boards.straightdope.com/u/F.Pu-du-he-pa-as)
#### Post date: [November 24, 2015, 5:02pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/6 "2015-11-24T17:02:41Z")

</div>

Thanks for sharing! Math is awesome!

---

<div class="post-metadata">

### Author: ![bup](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bup](https://boards.straightdope.com/u/bup)
#### Post date: [November 24, 2015, 5:14pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/7 "2015-11-24T17:14:47Z")

</div>

> [@Senegoid](#):
>
> Playing with this a little more, I discovered that any palindromic number with an even number of digits must be divisible by 11.

Why is that?

---

<div class="post-metadata">

### Author: ![Knowed\_Out](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/knowed_out/32/7380_2.png) [@Knowed\_Out](https://boards.straightdope.com/u/Knowed_Out)
#### Post date: [November 24, 2015, 5:47pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/8 "2015-11-24T17:47:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![bup](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bup](https://boards.straightdope.com/u/bup)
#### Post date: [November 24, 2015, 5:53pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/9 "2015-11-24T17:53:12Z")

</div>

> [@knowed out](#):
>
> 3 x 142857 = 428751

1.

---

<div class="post-metadata">

### Author: ![D18](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@D18](https://boards.straightdope.com/u/D18)
#### Post date: [November 24, 2015, 5:55pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/10 "2015-11-24T17:55:04Z")

</div>

> [@beowulff](#):
>
> That’s a neat trick, but how often do you want to know if a number is evenly divisible by eleven?

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

---

<div class="post-metadata">

### Author: ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)
#### Post date: [November 24, 2015, 6:17pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/11 "2015-11-24T18:17:07Z")

</div>

> [@bup](#):
>
> Why is that?

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.

---

<div class="post-metadata">

### Author: ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)
#### Post date: [November 24, 2015, 6:23pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/12 "2015-11-24T18:23:54Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Channing\_Idaho\_Banks](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/channing_idaho_banks/32/250_2.png) [@Channing\_Idaho\_Banks](https://boards.straightdope.com/u/Channing_Idaho_Banks)
#### Post date: [November 24, 2015, 7:06pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/13 "2015-11-24T19:06:56Z")

</div>

867-5309

---

<div class="post-metadata">

### Author: ![bup](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bup](https://boards.straightdope.com/u/bup)
#### Post date: [November 24, 2015, 7:07pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/14 "2015-11-24T19:07:19Z")

</div>

> [@LSLGuy](#):
>
> Pretty trivial really.
> 
> …  
> 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.

:smack: Thank you.

---

<div class="post-metadata">

### Author: ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)
#### Post date: [November 24, 2015, 8:20pm UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/15 "2015-11-24T20:20:59Z")

</div>

Yes, but what about post #5? 😃

---

<div class="post-metadata">

### Author: ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)
#### Post date: [November 25, 2015, 3:13am UTC](https://boards.straightdope.com/t/i-am-megadork-who-thinks-about-math-for-no-reason/738374/16 "2015-11-25T03:13:13Z")

</div>

> [@LSLGuy](#):
>
> Yes, but what about post #5? 😃

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.
