cp's OEIS Frontend

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.

A118595 Palindromes in base 4 (written in base 4).

Original entry on oeis.org

0, 1, 2, 3, 11, 22, 33, 101, 111, 121, 131, 202, 212, 222, 232, 303, 313, 323, 333, 1001, 1111, 1221, 1331, 2002, 2112, 2222, 2332, 3003, 3113, 3223, 3333, 10001, 10101, 10201, 10301, 11011, 11111, 11211, 11311, 12021, 12121, 12221, 12321, 13031
Offset: 1

Views

Author

Martin Renner, May 08 2006

Keywords

Comments

2*a(n) and 3*a(n) give palindromes in base 10 for any n. - Arkadiusz Wesolowski, Jun 22 2012
Equivalently, palindromes k (written in base 10) such that 3*k is a palindrome. - Bruno Berselli, Sep 12 2018

Crossrefs

Programs

  • Mathematica
    (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 290], Max@IntegerDigits@# < 4 &] (* Robert G. Wilson v, May 09 2006 *)
  • Python
    from gmpy2 import digits
    def A118595(n):
        if n == 1: return 0
        y = (x:=1<<(n.bit_length()-2&-2))<<2
        return int((s:=digits(n-x,4))+s[-2::-1] if nChai Wah Wu, Jun 14 2024

Extensions

More terms from Robert G. Wilson v, May 09 2006