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 A118598 #12 Jun 15 2024 09:26:03 %S A118598 0,1,2,3,4,5,6,11,22,33,44,55,66,101,111,121,131,141,151,161,202,212, %T A118598 222,232,242,252,262,303,313,323,333,343,353,363,404,414,424,434,444, %U A118598 454,464,505,515,525,535,545,555,565,606,616,626,636,646,656,666,1001 %N A118598 Palindromes in base 7 (written in base 7). %t A118598 (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 109], Max@IntegerDigits@# < 7 &] (* _Robert G. Wilson v_, May 09 2006 *) %o A118598 (Python) %o A118598 from sympy import integer_log %o A118598 from gmpy2 import digits %o A118598 def A118598(n): %o A118598 if n == 1: return 0 %o A118598 y = 7*(x:=7**integer_log(n>>1,7)[0]) %o A118598 return int((s:=digits(n-x,7))+s[-2::-1] if n<x+y else (s:=digits(n-y,7))+s[::-1]) # _Chai Wah Wu_, Jun 14 2024 %Y A118598 Cf. A029954, A057148, A118594, A118595, A118596, A118597, A118598, A118599, A118600, A002113. %K A118598 nonn,base %O A118598 1,3 %A A118598 _Martin Renner_, May 08 2006 %E A118598 Corrected and extended by _Robert G. Wilson v_, May 09 2006