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

## Post Author

Posted November 5th, 2009, by **Colin Walls**

## Post Tags

## Post Comments

## About The Colin Walls Blog

This blog is a discussion of embedded software matters - news, comment, technical issues and ideas, along with other passing thoughts about anything that happens to be on my mind. The Colin Walls Blog

## @colin_walls tweets

- #ColinWallsBlog For a change, instead of a technical discussion, I am talking about getting into embedded https://t.co/6d2abxTj1B
- #ColinWallsBlog Securing #IoT devices https://t.co/iNQ34lWWzV https://t.co/AeybuUDXaB
- #ColinWallsBlog Embedded software video blog about the C keyword static https://t.co/Dk0n3TaouE

## One comment on this post | ↓ Add Your Own

Commented on 13 November 2009 at 22:40

By Anthony Mo

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!