{"id":548,"date":"2009-11-05T09:22:20","date_gmt":"2009-11-05T08:22:20","guid":{"rendered":"https:\/\/blogs.mentor.com\/colinwalls\/?p=548"},"modified":"2026-03-26T16:31:17","modified_gmt":"2026-03-26T20:31:17","slug":"palendromic-numbers","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/embedded-software\/2009\/11\/05\/palendromic-numbers\/","title":{"rendered":"Palindromic numbers"},"content":{"rendered":"<p>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\u00f6s used to refer to &#8220;The Book&#8221;, 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.<\/p>\n<p>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.<\/p>\n<p>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 &#8230;<!--more--><\/p>\n<p>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 &#8211; that is a number that reads the same left to right and right to left. For example:<\/p>\n<ul>\n<li>1658+8561=10219<\/li>\n<li>10219+91201=101420<\/li>\n<li>101420+24101=125521<\/li>\n<\/ul>\n<p>There seemed to be no explanation for this observation. I had no idea how you might prove it to be a &#8220;rule&#8221;, 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.<\/p>\n<p>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 &#8220;think&#8221; 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.<\/p>\n<p>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:<\/p>\n<ul>\n<li>Can I find all 6 exceptions?<\/li>\n<li>What about other number bases?<\/li>\n<\/ul>\n<p>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 &#8211; either <a href=\"mailto:colin_walls@mentor.com\">email<\/a> or comment would be welcome.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Even though I have not studied mathematics very deeply, I have always liked numbers. I like the way that they&#8230;<\/p>\n","protected":false},"author":71677,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[1],"tags":[302],"industry":[],"product":[],"coauthors":[],"class_list":["post-548","post","type-post","status-publish","format-standard","hentry","category-news","tag-off-topic"],"_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/users\/71677"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/comments?post=548"}],"version-history":[{"count":1,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/548\/revisions"}],"predecessor-version":[{"id":9802,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/548\/revisions\/9802"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/media?parent=548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/categories?post=548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/tags?post=548"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/industry?post=548"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/product?post=548"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/coauthors?post=548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}