Stump your fellow simians.
Posts: 102
Joined: Sat Aug 21, 2004 12:16 am


Post by Sentzeu »

Hi to you all, this is my first post. Here's the first math puzzle that I've ever submitted.

Can any palindrom with an 2n number of digits be divided by 11?





Posts: 297
Joined: Wed Jun 09, 2004 3:15 pm

Post by Brown »

Answer: Yes.

A test for divisibility by 11 is to add up the two sets of alternate digits in a number and see if they are identical or if they differ from each other by a factor of 11. If they do, the whole number is divisible by 11. For example, in determining whether 12,345,674 is divisible by 11, add 1+3+5+7 (the first, third, fifth and seventh digits) and compare to 2+4+6+4 (the second, fourth, sixth and eighth digits). In this case, both sums are identical, so 12,345,674 is divisible by 11.

In the case of a palindromic number having an even number of digits, the sums of alternate digits will always be the same.
Posts: 2868
Joined: Tue Jun 08, 2004 8:55 pm
Location: That Good Night

Post by Beleth »


Bah, Brown beat me to it.
Posts: 102
Joined: Sat Aug 21, 2004 12:16 am

Post by Sentzeu »

I encountered this problem in a programming competetion.

We had to write a program that would find all palindromic primes up to 1000000. The first step we devised was to first generate a list of palindromes and then I suddenly realised that we only needed those with an odd number of digits. Counting off those who began with an even digit or 5 and we only needed to check 360 candidates.

Then after devising a quick prime checker we had ourselves a rather fast palindromic prime generator.

By the way the program had to be run on a 44Mhz processor platform within a certain timelimit and the language we made the program in was C, of course.