This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A118597 #18 Jun 15 2024 09:25:57 %S A118597 0,1,2,3,4,5,11,22,33,44,55,101,111,121,131,141,151,202,212,222,232, %T A118597 242,252,303,313,323,333,343,353,404,414,424,434,444,454,505,515,525, %U A118597 535,545,555,1001,1111,1221,1331,1441,1551,2002,2112,2222,2332,2442,2552 %N A118597 Palindromes in base 6 (written in base 6). %C A118597 Also palindromes with no digit greater than 5. - _Harvey P. Dale_, Nov 26 2019 %H A118597 Harvey P. Dale, <a href="/A118597/b118597.txt">Table of n, a(n) for n = 1..1000</a> %t A118597 (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 125], Max@IntegerDigits@# < 6 &] (* _Robert G. Wilson v_, May 09 2006 *) %t A118597 Select[FromDigits/@Tuples[Range[0,5],4],PalindromeQ] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Nov 26 2019 *) %o A118597 (Python) %o A118597 from sympy import integer_log %o A118597 from gmpy2 import digits %o A118597 def A118597(n): %o A118597 if n == 1: return 0 %o A118597 y = 6*(x:=6**integer_log(n>>1,6)[0]) %o A118597 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 %Y A118597 Cf. A029953, A057148, A118594, A118595, A118596, A118597, A118598, A118599, A118600, A002113. %K A118597 nonn,base %O A118597 1,3 %A A118597 _Martin Renner_, May 08 2006 %E A118597 Corrected and extended by _Robert G. Wilson v_, May 09 2006