OFFSET
1,1
COMMENTS
All integers are trivially palindromes in base 1. All integers n>2 are trivially 2-digit palindromes because they can be represented as "11" in base n-1.
EXAMPLE
5 is present because the palindrome (101 base 2) = 5; 803 is present because (30203 base 4) = 803.
MATHEMATICA
palindromeQ[n_, b_] := (id = IntegerDigits[n, b]) === Reverse[id] && Length[id] >= 3; palindromeQ[n_] := Or @@ (palindromeQ[n, #] & ) /@ Range[2, n-2]; Select[ Range[110], palindromeQ] (* Jean-François Alcover, Dec 16 2011 *)
PROG
(Haskell) isPalindrome s = (s == reverse s) digits 0 _ = [] digits n b = n `rem` b : digits (n `quot` b) b check n = any isPalindrome $ takeWhile (\x -> length x > 2) $ map (digits n) [2..] main = mapM print $ filter check [1..]
(PARI) isok(n) = for (b=2, n-1, if ((d=digits(n, b)) && (#d >= 3) && (Vecrev(d) == d), return (1)); ); \\ Michel Marcus, Jul 28 2016
CROSSREFS
KEYWORD
easy,base,nonn
AUTHOR
Jason Orendorff (jason.orendorff(AT)gmail.com), Feb 05 2006
EXTENSIONS
Cross-references from Charles R Greathouse IV, Aug 04 2010
STATUS
approved