I was surprised to learn from a comment on Project Euler that palindromic numbers are always divisible by 11.
Here's the proof (for six digit numbers):
i.) A palindromic number has the form abccba [By definition]
ii.) abccba = 100000a + 10000b + 1000c + 100c + 10b + a [Expansion in Base 10]
iii.) abccba = (100000a + a) + (10000b + 10b) + (1000c + 100c) [Re-organizing ii.)]
iv.) abccba = 100001a + 10010b + 1100c [Re-organizing iii.)]
v.) abccba = 11 (9091a + 910b + 100c) [Factor out 11 from iv.)]
QED [= Proved, since we have factored 11 out.]
I think this always holds for palindromes (of any length) with an even number of characters, but it does not necessarily hold if you are allowed to include an 'odd' digit in the centre. (I know it sometimes holds because 121 = 11 x 11, but I don't know if 121 is a special case.)
No comments:
Post a Comment