OFFSET
1,3
COMMENTS
Also palindromes with no digit greater than 5. - Harvey P. Dale, Nov 26 2019
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
MATHEMATICA
(* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 125], Max@IntegerDigits@# < 6 &] (* Robert G. Wilson v, May 09 2006 *)
Select[FromDigits/@Tuples[Range[0, 5], 4], PalindromeQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 26 2019 *)
PROG
(Python)
from sympy import integer_log
from gmpy2 import digits
def A118597(n):
if n == 1: return 0
y = 6*(x:=6**integer_log(n>>1, 6)[0])
return int((s:=digits(n-x, 6))+s[-2::-1] if n<x+y else (s:=digits(n-y, 6))+s[::-1]) # Chai Wah Wu, Jun 14 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Martin Renner, May 08 2006
EXTENSIONS
Corrected and extended by Robert G. Wilson v, May 09 2006
STATUS
approved