%I #12 Sep 08 2022 08:46:10
%S 0,1,2,3,4,5,6,7,8,9,11,22,33,111,222,333,444,555,666,777,888,999,
%T 1221,1441,2882,5115,12321,16861,19491,21112,30803,33433,36063,37973,
%U 42224,159951,741147,987789,1301031,1867681,3315133,4306034,5182815,5927295,6918196,6950596,9242429,9488849,10066001,48655684
%N Palindromic in bases 10 and 36.
%H Robert G. Wilson v, <a href="/A250412/b250412.txt">Table of n, a(n) for n = 1..93</a>
%t palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; genPal[n_] := Block[{id = IntegerDigits@ n, insert = {{}, {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}}}, FromDigits@ Join[id, #, Reverse@ id] & /@ insert]; k = 1; lst = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; While[k < 1000001, s = Select[ genPal[k], palQ[#, 36] &]; If[s != {}, AppendTo[lst, s]; Print@ s; lst = Sort@ Flatten@ lst]; k++]; lst
%t b1=10; b2=36; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10000000}]; lst (* _Vincenzo Librandi_, Nov 23 2014 *)
%t Select[Range[0,49*10^6],PalindromeQ[#]&&IntegerDigits[#,36]== Reverse[ IntegerDigits[ #,36]]&] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Feb 04 2019 *)
%o (Magma) [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 36) eq Reverse(Intseq(n, 36))]; // _Vincenzo Librandi_, Nov 23 2014
%Y Cf. A007632, A007633, A029961, A029962, A029963, A029964, A029804, A029965, A029966, A029967, A029968, A029969, A029970, A029731, A097855, A250408, A250409, A250410, A250411, A099165.
%K nonn,base
%O 1,3
%A _Robert G. Wilson v_, Nov 23 2014
|