A b-palindrome is an integer that is a palindrome in base
b.
Show how to find a number that is a b-palindrome, of at least three digits, for at least 1000 different values of b.
For example, 200 is not a 10-palindrome, but it is a 9-palindrome (242) and a 7-palindrome (404).
There is a process where you can create palindromic numbers by taking any number x, reversing the digits to make a new number y, then add x to y. If the result is a palindrome you stop, otherwise you replace x with the new number and repeat the process.
If you start with some number in base 2 and repeat the 'MakeAPalindrome' process until you get a palindrome, then compare that value with the same value in base 3 to see if it's a palindrome. If not, repeat the 'MakeAPalindrome' process until you get a palindrome in both bases.
Repeat this process with ever increasing bases until you get a number which is palindromic in all bases..
It has also ocurred to me that an odd-digit palindrome in base n is also an odd digit palindrome in base n^x. By sticking with odd-digit palindromes you could eliminate testing all subsequent bases of n^x after finding a palindrome in base n.
|
Posted by Erik
on 2004-06-03 23:02:00 |