OFFSET
1,3
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..510
Edray Herber Goins, Palindromes in Different Bases: A Conjecture of J. Ernest Wilkins, Integers 9 (2009), 725-734.
EXAMPLE
a(11) = 33 = {1,0,0,0,1} in base 2;
a(99) = 909909 = {3, 1, 3, 0, 0, 3, 1, 3} in base 6;
a(98) = 848848 = {1, 1, 2, 1, 0, 1, 0, 1, 0, 1, 2, 1, 1} in base 3.
MAPLE
N:= 6: # to get all terms of up to N digits
digrev:= proc(n) local L;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L));
end proc:
basepali:= proc(b, n)
local L;
L:= convert(n, base, b);
evalb(L = ListTools:-Reverse(L))
end proc:
Res:= $0..9:
for d from 2 to N do
if d::even then
m:= d/2;
Res:= Res, seq(n*10^m + digrev(n), n=10^(m-1)..10^m-1);
else
m:= (d-1)/2;
Res:= Res, seq(seq(n*10^(m+1)+y*10^m+digrev(n), y=0..9), n=10^(m-1)..10^m-1);
fi
od:
select(t -> ormap(basepali, [$2..9], t), [Res]); # Robert Israel, Oct 15 2014
MATHEMATICA
palQ[n_Integer, base_Integer]:=Block[{}, Reverse[idn=IntegerDigits[n, base]]==idn]
; Select[Range[0, 10000], palQ[#, 10] && (palQ[#, 2] || palQ[#, 3] || palQ[#, 4] || palQ[#, 5] || palQ[#, 6] || palQ[#, 7] || palQ[#, 8] || palQ[#, 9]) &] (* Robert G. Wilson v, Oct 10 2014 *)
palQ[n_, b_]:=Module[{idb=IntegerDigits[n, b]}, idb==Reverse[idb]]; pal2to9[n_]:=Total[Boole[ Table[palQ[n, b], {b, 2, 9}]]]>0; Select[Range[0, 10000], PalindromeQ[#]&&pal2to9[#]&] (* Harvey P. Dale, Jul 13 2023 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
José María Grau Ribas, Feb 21 2010
EXTENSIONS
Term 0 prepended by Robert G. Wilson v, Oct 10 2014
Definition clarified by Harvey P. Dale, Jul 13 2023
STATUS
approved