Title: | Mathematics at DEC |
Moderator: | RUSURE::EDP |
Created: | Mon Feb 03 1986 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 2083 |
Total number of notes: | 14613 |
This may be of interest to the regular readers here. A coworker's daughter came home with this 4th grade arithmetic problem. A number is a palindrome if its (base 10) representation is the same when reversed. Many numbers can be turned into palindromes by this algorithm: add the number to its reversed representation e.g: 123 +321 ==== 444 Thus 123 turns into a palindrome after one iteration. Can you tell if a number will become a palindrome if the above algorithm is applied enough times? For example, 196 will not turn into a palindrome after 3,500 iteration. Interestingly most numbers (under 2,000) will result in palindromes in 25 or so iterations. Already this has absorbed enough developers' time, so we turn it loose on you. A program to perform these calculations in variable-precision arithmetic is available in TLE::FORD2$:[PETERSON.PUBLIC]PAL.FOR. Any intensive work should perhaps be run on a low-use machine. (Already we've found a property of we call family trees in the numbers which do not become palindromes, aka `magic' numbers to us. We have not been able to predict these arbitrarily.)
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
945.1 | 525.* | LISP::DERAMO | Daniel V. {AITG,LISP,ZFC}:: D'Eramo | Thu Oct 13 1988 17:42 | 3 |
See note 525 and its replies. Dan | |||||
945.2 | Caught | TLE::PETERSON | Bob | Thu Oct 13 1988 18:41 | 3 |
Arg! Well, if people used standard english I would have found that note when I searched for DIRECTORY/TITLE=PALINDROME. I suppose I should have anticipated this. | |||||
945.3 | LISP::DERAMO | Daniel V. {AITG,LISP,ZFC}:: D'Eramo | Thu Oct 13 1988 19:00 | 6 | |
You have to play it by ear. Sometimes leaving off trailing letters (that would be chopped off by a suffix) when doing a search helps, but other times it results in finding too much. Dan |