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).

This page as a plain text file.
%I A118600 #18 Jun 15 2024 10:19:28
%S A118600 0,1,2,3,4,5,6,7,8,11,22,33,44,55,66,77,88,101,111,121,131,141,151,
%T A118600 161,171,181,202,212,222,232,242,252,262,272,282,303,313,323,333,343,
%U A118600 353,363,373,383,404,414,424,434,444,454,464,474,484,505,515,525,535,545
%N A118600 Palindromes in base 9 (written in base 9).
%H A118600 Chai Wah Wu, <a href="/A118600/b118600.txt">Table of n, a(n) for n = 1..1457</a>
%t A118600 (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 62], Max@IntegerDigits@# < 9 &] (* _Robert G. Wilson v_, May 09 2006 *)
%o A118600 (Python)
%o A118600 from gmpy2 import digits
%o A118600 def palgenbase(l,b): # generator of palindromes in base b <=10 of length <= 2*l, written in base b
%o A118600     if l > 0:
%o A118600         yield 0
%o A118600         for x in range(1,l+1):
%o A118600             for y in range(b**(x-1),b**x):
%o A118600                 s = digits(y,b)
%o A118600                 yield int(s+s[-2::-1])
%o A118600             for y in range(b**(x-1),b**x):
%o A118600                 s = digits(y,b)
%o A118600                 yield int(s+s[::-1])
%o A118600 A118600_list = list(palgenbase(3,9)) # _Chai Wah Wu_, Dec 01 2014
%o A118600 (Python)
%o A118600 from sympy import integer_log
%o A118600 from gmpy2 import digits
%o A118600 def A118600(n):
%o A118600     if n == 1: return 0
%o A118600     y = 9*(x:=9**integer_log(n>>1,9)[0])
%o A118600     return int((s:=digits(n-x,9))+s[-2::-1] if n<x+y else (s:=digits(n-y,9))+s[::-1]) # _Chai Wah Wu_, Jun 14 2024
%Y A118600 Cf. A029955, A057148, A118594, A118595, A118596, A118597, A118598, A118599, A118600, A002113.
%K A118600 nonn,base
%O A118600 1,3
%A A118600 _Martin Renner_, May 08 2006
%E A118600 More terms from _Robert G. Wilson v_, May 09 2006