login
A259377
Palindromic numbers in bases 3 and 7 written in base 10.
16
0, 1, 2, 4, 8, 16, 40, 100, 121, 142, 164, 242, 328, 400, 1312, 8200, 9103, 14762, 54008, 76024, 108016, 112048, 233920, 532900, 639721, 741586, 2585488, 3316520, 11502842, 24919360, 35664908, 87001616, 184827640, 4346524576, 5642510512, 11641189600, 65304259157, 68095147754, 469837033600, 830172165614, 17136683996456, 21772277941544, 22666883572232, 45221839119556
OFFSET
1,3
FORMULA
Intersection of A014190 and A029954.
EXAMPLE
142 is in the sequence because 142_10 = 262_7 = 12021_3.
MATHEMATICA
(* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 7]; If[palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
b1=3; b2=7; 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, Jul 17 2015 *)
KEYWORD
nonn,base
AUTHOR
Eric A. Schmidt and Robert G. Wilson v, Jul 16 2015
STATUS
approved