OFFSET
0,6
COMMENTS
Every integer n is a palindrome when expressed in unary, or in base n-1 (where it will be 11).
First occurrence in A037183.
a(n) is always less than A001221(n) except for 2 and 6; a(n) is always less than A001222(n) except for even powers of twos and 6, 12, 81, 243, 625, 729, 2187, 19683, 59049, ..., . - Robert G. Wilson v, Jul 17 2016
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..100000
John P. Linderman, Description of A135549-A135551 and A016038
John P. Linderman, Perl program [Use the command: BASEDELTA=0 palin.pl]
FORMULA
a(n) = A126071(n) - 1. - Michel Marcus, Mar 07 2015
MATHEMATICA
palindromicBases[n_] := Module[{p}, Table[p = IntegerDigits[n, b]; If[p == Reverse[p], {b, p}, Sequence @@ {}], {b, 2, n - 1}]]; Array[ Length@ palindromicBases@# &, 105, 0] (* Robert G. Wilson v, Oct 15 2014 *)
palQ[n_Integer, base_Integer] := Module[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]];
f[n_] := Block[{s = Ceiling@ Sqrt@ n, b = 2, c = If[ IntegerQ@ Sqrt[4n + 1], -1, 0]}, While[b < s, If[ palQ[n, b], c++]; b++]; c + Count[ Mod[n, Range[s - 1]], 0]]; f[0] = 0; Array[f, 105, 0] (* much faster for large Ns *) (* Robert G. Wilson v, Oct 20 2014 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
John P. Linderman, Feb 26 2008, Feb 28 2008
STATUS
approved