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 A118595 #23 Jun 15 2024 01:02:29 %S A118595 0,1,2,3,11,22,33,101,111,121,131,202,212,222,232,303,313,323,333, %T A118595 1001,1111,1221,1331,2002,2112,2222,2332,3003,3113,3223,3333,10001, %U A118595 10101,10201,10301,11011,11111,11211,11311,12021,12121,12221,12321,13031 %N A118595 Palindromes in base 4 (written in base 4). %C A118595 2*a(n) and 3*a(n) give palindromes in base 10 for any n. - _Arkadiusz Wesolowski_, Jun 22 2012 %C A118595 Equivalently, palindromes k (written in base 10) such that 3*k is a palindrome. - _Bruno Berselli_, Sep 12 2018 %t A118595 (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 290], Max@IntegerDigits@# < 4 &] (* _Robert G. Wilson v_, May 09 2006 *) %o A118595 (Python) %o A118595 from gmpy2 import digits %o A118595 def A118595(n): %o A118595 if n == 1: return 0 %o A118595 y = (x:=1<<(n.bit_length()-2&-2))<<2 %o A118595 return int((s:=digits(n-x,4))+s[-2::-1] if n<x+y else (s:=digits(n-y,4))+s[::-1]) # _Chai Wah Wu_, Jun 14 2024 %Y A118595 Cf. A014192, A057148, A118594, A118595, A118596, A118597, A118598, A118599, A118600, A002113. %K A118595 nonn,base %O A118595 1,3 %A A118595 _Martin Renner_, May 08 2006 %E A118595 More terms from _Robert G. Wilson v_, May 09 2006