OFFSET
1,3
COMMENTS
Next term > 10^12.
EXAMPLE
838 = 262 in base 19.
MAPLE
IsPalindromic := proc(n, Base) local Conv, i;
Conv := convert(n, base, Base);
for i from 1 to nops(Conv) / 2 do:
if Conv [i] <> Conv [nops(Conv) + 1 - i] then
return false:
fi:
od:
return true;
end proc;
Base := 19;
A := [];
for i from 1 to 10^6 do:
S := convert(i, base, 10);
V := 0;
if i mod 10 = 0 then
next;
fi;
for j from 1 to nops(S) do:
V := V * 10 + S [j];
od:
for j from 0 to 10 do:
V1 := V * 10^(nops(S) + j) + i;
if IsPalindromic(V1, Base) then
A := [op(A), V1];
fi;
od:
V1 := (V - (V mod 10)) * 10^(nops(S) - 1) + i;
if IsPalindromic(V1, Base) then
A := [op(A), V1];
fi;
od:
sort(A);
MATHEMATICA
palQ[n_, b_] := Block[{d = IntegerDigits[n, b]}, If[d == Reverse@ d, True, False]]; Select[Range[0, 10^6], And[palQ[#, 10], palQ[#, 19]] &] (* Michael De Vlieger, Mar 07 2015 *)
b1=10; b2=19; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10^7}]; lst (* Vincenzo Librandi, Mar 08 2015 *)
PROG
(PARI) isok(n) = (n==0) || ((d = digits(n, 10)) && (Vecrev(d) == d) && (d = digits(n, 19)) && (Vecrev(d) == d)); \\ Michel Marcus, Mar 07 2015
(Magma) [n: n in [0..2*10^7] | Intseq(n) eq Reverse(Intseq(n))and Intseq(n, 19) eq Reverse(Intseq(n, 19))]; // Vincenzo Librandi, Mar 08 2015
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Mauro Fiorentini, Mar 06 2015
STATUS
approved