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.

A118596 Palindromes in base 5 (written in base 5).

Original entry on oeis.org

0, 1, 2, 3, 4, 11, 22, 33, 44, 101, 111, 121, 131, 141, 202, 212, 222, 232, 242, 303, 313, 323, 333, 343, 404, 414, 424, 434, 444, 1001, 1111, 1221, 1331, 1441, 2002, 2112, 2222, 2332, 2442, 3003, 3113, 3223, 3333, 3443, 4004, 4114, 4224, 4334, 4444, 10001
Offset: 1

Views

Author

Martin Renner, May 08 2006

Keywords

Comments

Equivalently, palindromes k (written in base 10) such that 2*k is a palindrome. - Bruno Berselli, Sep 12 2018

Crossrefs

Programs

  • Mathematica
    (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 198], Max@IntegerDigits@# < 5 &] (* Robert G. Wilson v, May 09 2006 *)
    Select[FromDigits/@IntegerDigits[Range[1000],5],PalindromeQ] (* Fred Patrick Doty, Aug 12 2017 *)
  • 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
    
  • Python
    from sympy import integer_log
    from gmpy2 import digits
    def A118596(n):
        if n == 1: return 0
        y = 5*(x:=5**integer_log(n>>1,5)[0])
        return int((s:=digits(n-x,5))+s[-2::-1] if nChai Wah Wu, Jun 14 2024

Extensions

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