login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A135549
Number of bases b, 1 < b < n-1, in which n is a palindrome.
11
0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 2, 2, 2, 0, 2, 3, 1, 1, 3, 1, 3, 2, 3, 1, 2, 2, 2, 2, 2, 1, 4, 1, 2, 1, 4, 1, 3, 1, 2, 3, 3, 0, 4, 1, 3, 3, 4, 0, 3, 3, 3, 3, 1, 1, 5, 1, 2, 4, 3, 4, 3, 2, 3, 1, 3, 1, 5, 2, 2, 2, 2, 1, 5, 0, 6, 2, 3, 1, 5, 4, 2, 1, 4, 1, 4, 3, 4, 3, 1, 1, 5, 1, 4, 3, 6, 1, 3, 0, 5
OFFSET
0,11
COMMENTS
Every integer n is a palindrome when expressed in unary, or in base n-1 (where it will be 11). So here we assume 1 < b < n-1.
Records for a(n)>=1 are in A107129. - Dmitry Kamenetsky, Oct 22 2015
LINKS
John P. Linderman, Perl program [Use the command: palin.pl]
FORMULA
a(n) = A065531(n)-1 = A126071(n)-2 for n>2. - T. D. Noe, Feb 28 2008
MATHEMATICA
a = {0, 0, 0}; For[n = 4, n < 100, n++, c = 0; For[b = 2, b < n - 1, b++, If[IntegerDigits[n, b] == Reverse[IntegerDigits[n, b]], c++ ]]; AppendTo[a, c]]; a (* Stefan Steinerberger, Feb 27 2008 *)
Table[cnt=0; Do[d=IntegerDigits[n, b]; If[d==Reverse[d], cnt++ ], {b, 2, n-2}]; cnt, {n, 0, 100}] (* T. D. Noe, Feb 28 2008 *)
Table[Total[Boole[Table[PalindromeQ[IntegerDigits[n, b]], {b, 2, n-2}]]], {n, 0, 120}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 14 2020 *)
CROSSREFS
Cf. A016038 (non-palindromic numbers in any base 1 < b < n-1)
Sequence in context: A331545 A349465 A035697 * A262666 A124737 A121303
KEYWORD
nonn,base
AUTHOR
John P. Linderman, Feb 26 2008, Feb 28 2008
STATUS
approved