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 A118596 #28 Jun 15 2024 02:10:28 %S A118596 0,1,2,3,4,11,22,33,44,101,111,121,131,141,202,212,222,232,242,303, %T A118596 313,323,333,343,404,414,424,434,444,1001,1111,1221,1331,1441,2002, %U A118596 2112,2222,2332,2442,3003,3113,3223,3333,3443,4004,4114,4224,4334,4444,10001 %N A118596 Palindromes in base 5 (written in base 5). %C A118596 Equivalently, palindromes k (written in base 10) such that 2*k is a palindrome. - _Bruno Berselli_, Sep 12 2018 %t A118596 (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 198], Max@IntegerDigits@# < 5 &] (* _Robert G. Wilson v_, May 09 2006 *) %t A118596 Select[FromDigits/@IntegerDigits[Range[1000],5],PalindromeQ] (* _Fred Patrick Doty_, Aug 12 2017 *) %o A118596 (PARI) is(n)=if(n<5, return(n>=0)); my(d=digits(n)); vecmax(d)<5 && Vecrev(d)==d \\ _Charles R Greathouse IV_, Aug 22 2017 %o A118596 (Python) %o A118596 from sympy import integer_log %o A118596 from gmpy2 import digits %o A118596 def A118596(n): %o A118596 if n == 1: return 0 %o A118596 y = 5*(x:=5**integer_log(n>>1,5)[0]) %o A118596 return int((s:=digits(n-x,5))+s[-2::-1] if n<x+y else (s:=digits(n-y,5))+s[::-1]) # _Chai Wah Wu_, Jun 14 2024 %Y A118596 Cf. A029952, A057148, A118594, A118595, A118596, A118597, A118598, A118599, A118600, A002113. %K A118596 nonn,base %O A118596 1,3 %A A118596 _Martin Renner_, May 08 2006 %E A118596 More terms from _Robert G. Wilson v_, May 09 2006