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.

A118600 Palindromes in base 9 (written in base 9).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 22, 33, 44, 55, 66, 77, 88, 101, 111, 121, 131, 141, 151, 161, 171, 181, 202, 212, 222, 232, 242, 252, 262, 272, 282, 303, 313, 323, 333, 343, 353, 363, 373, 383, 404, 414, 424, 434, 444, 454, 464, 474, 484, 505, 515, 525, 535, 545
Offset: 1

Views

Author

Martin Renner, May 08 2006

Keywords

Crossrefs

Programs

  • Mathematica
    (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 62], Max@IntegerDigits@# < 9 &] (* Robert G. Wilson v, May 09 2006 *)
  • Python
    from gmpy2 import digits
    def palgenbase(l,b): # generator of palindromes in base b <=10 of length <= 2*l, written in base b
        if l > 0:
            yield 0
            for x in range(1,l+1):
                for y in range(b**(x-1),b**x):
                    s = digits(y,b)
                    yield int(s+s[-2::-1])
                for y in range(b**(x-1),b**x):
                    s = digits(y,b)
                    yield int(s+s[::-1])
    A118600_list = list(palgenbase(3,9)) # Chai Wah Wu, Dec 01 2014
    
  • Python
    from sympy import integer_log
    from gmpy2 import digits
    def A118600(n):
        if n == 1: return 0
        y = 9*(x:=9**integer_log(n>>1,9)[0])
        return int((s:=digits(n-x,9))+s[-2::-1] if nChai Wah Wu, Jun 14 2024

Extensions

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