A319609 Numbers in base 10 that are palindromic in bases 4, 8 and 16.
0, 1, 2, 3, 5, 170, 4095, 4097, 8194, 12291, 20485, 21845, 696490, 699050, 16777215, 16777217, 16781313, 16785409, 16789505, 33554434, 33558530, 33562626, 33566722, 50331651, 50335747, 50339843, 50343939, 83886085, 83906565, 89458005, 89478485
Offset: 1
Examples
170 = 2222_4 = 252_8 = AA_16. Hence 170 is in the sequence.
Programs
-
Magma
[n: n in [0..2*10^7] | Intseq(n, 4) eq Reverse(Intseq(n, 4)) and Intseq(n, 8) eq Reverse(Intseq(n, 8)) and Intseq(n, 16) eq Reverse(Intseq(n, 16))]; // Vincenzo Librandi, Sep 24 2018
-
Mathematica
palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]]; Reap[Do[If[palQ[n, 4] && palQ[n, 8] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
-
Sage
[n for n in (0..100000) if Word(n.digits(4)).is_palindrome() and Word(n.digits(8)).is_palindrome() and Word(n.digits(16)).is_palindrome()]