Thought Leadership

Palindromic numbers

Even though I have not studied mathematics very deeply, I have always liked numbers. I like the way that they behave as if governed by some set of divine rules, which are hidden from us. The mathematician Paul Erdös used to refer to “The Book”, which was a complete set of mathematical rules written and maintained by God. He hoped that this would be revealed to him when he died.

I have no such lofty expectations, but I do wonder about mathematical rules and puzzles. A simple one is that, if the sum of the digits of a number is a multiple of 3, then the original number is also a multiple of 3. Of course, repeating the adding up process will always yield 3, 6 or 9.

I do spend time messing with puzzles. I have assiduously avoided learning Sudoku, as I know I would waste large chunks of my life on it. Many years ago I was fascinated by the phenomenon of palindromic numbers …

It was about 1978 that I read an article in Scientific American or New Scientist or somewhere like that, which reported on an interesting effect: if you take a number, reverse the digits and add it to the original and repeat this process enough times, you will end up with a palindromic number – that is a number that reads the same left to right and right to left. For example:

  • 1658+8561=10219
  • 10219+91201=101420
  • 101420+24101=125521

There seemed to be no explanation for this observation. I had no idea how you might prove it to be a “rule”, as, to the best of my knowledge, reversing the digits is not a definable mathematical function. I was intrigued by the comment in the article that the rule worked for every number up to 10,000 with something like 6 exceptions.

Of course, I wanted to find these exceptions and wrote a program to search for them. I think I found one of them. I say “think” because I cannot be sure. Most numbers seemed to only require a few iterations, but I found one that went on for hundreds and still resulted in a very long, non-palindromic result. But I had no way of saying that it would never complete. I was also limited by computer resources. I had access to a CDC 7600 supercomputer at the University of London, but I could never run a job that required more than 20 minutes of total CPU time [which, in a timesharing context, took about a week]. I guess that computer would be out-performed by a modern laptop.

I have considered returning to this puzzle. Given a modern computer and more efficient programming, I think I could get a long way and address various questions:

  • Can I find all 6 exceptions?
  • What about other number bases?

I am not sure whether I will get around to this, but I would be very interested to hear if you have any knowledge, suggestions or views – either email or comment would be welcome.

Colin Walls

I have over thirty years experience in the electronics industry, largely dedicated to embedded software. A frequent presenter at conferences and seminars and author of numerous technical articles and two books on embedded software, I am a member of the marketing team of the Mentor Graphics Embedded Systems Division, and am based in the UK. Away from work, I have a wide range of interests including photography and trying to point my two daughters in the right direction in life. Learn more about Colin, including his go-to karaoke song and the best parts of being British: http://go.mentor.com/3_acv

More from this author

Comments

0 thoughts about “Palindromic numbers
  • I was fasinated by your mentioning of the palindromes. I stumbled on this link which you may find interesting. I have yet to digest all info there. I will have to see it to believe it. Happy number playing!

Leave a Reply

This article first appeared on the Siemens Digital Industries Software blog at https://blogs.sw.siemens.com/embedded-software/2009/11/05/palendromic-numbers/