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.

A050812 Number of times n is palindromic in bases b, 2 <= b <= 10.

This page as a plain text file.
%I A050812 #18 Sep 09 2021 09:35:20
%S A050812 9,9,8,8,7,7,5,5,4,3,3,1,1,1,1,2,2,2,2,0,2,3,1,1,2,1,2,2,2,1,1,2,1,2,
%T A050812 1,1,2,1,1,0,3,1,1,1,1,2,2,0,1,1,2,2,2,0,1,3,1,2,0,1,1,1,1,3,1,3,1,2,
%U A050812 1,0,1,1,1,2,1,0,0,1,2,0,3,1,2,1,0,3
%N A050812 Number of times n is palindromic in bases b, 2 <= b <= 10.
%H A050812 T. D. Noe, <a href="/A050812/b050812.txt">Table of n, a(n) for n = 0..10000</a>
%H A050812 Patrick De Geest, <a href="http://www.worldofnumbers.com/nobase10.htm">Palindromic numbers beyond base 10</a>
%e A050812 a(121) = 4 since 121_10, 171_8, 232_7 and 11111_3 are palindromes.
%t A050812 Table[Count[Table[IntegerDigits[n,b],{b,2,10}],_?(#==Reverse[#]&)],{n,0,90}] (* _Harvey P. Dale_, Aug 18 2012 *)
%o A050812 (Python)
%o A050812 from sympy.ntheory.digits import digits
%o A050812 def ispal(n, b):
%o A050812     digs = digits(n, b)[1:]
%o A050812     return digs == digs[::-1]
%o A050812 def a(n): return sum(ispal(n, b) for b in range(2, 11))
%o A050812 print([a(n) for n in range(87)]) # _Michael S. Branicky_, Sep 09 2021
%o A050812 (PARI) a(n) = sum(b=2, 10, my(d=digits(n, b)); d == Vecrev(d)); \\ _Michel Marcus_, Sep 09 2021
%Y A050812 Cf. A050813, A016038, A002113.
%K A050812 nonn,base
%O A050812 0,1
%A A050812 _Patrick De Geest_, Oct 15 1999