cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A319583 Numbers in base 10 that are palindromic in bases 2, 4, and 16.

This page as a plain text file.
%I A319583 #38 Nov 12 2023 12:22:01
%S A319583 0,1,3,5,15,17,51,85,255,257,273,771,819,1285,1365,3855,4095,4097,
%T A319583 4369,12291,13107,20485,21845,61455,65535,65537,65793,69649,69905,
%U A319583 196611,197379,208947,209715,327685,328965,348245,349525,983055,986895,1044735,1048575
%N A319583 Numbers in base 10 that are palindromic in bases 2, 4, and 16.
%C A319583 Intersection of A006995, A014192, and A029730.
%C A319583 This sequence is infinite as it contains 15*(1 + 16^k) for any k > 0. - _Rémy Sigrist_, Sep 23 2018
%C A319583 Palindromes in base 16 whose nonzero base-16 digits are either all 1, all 3, all 5 or all F (15). - _Robert Israel_, Nov 12 2023
%H A319583 Robert Israel, <a href="/A319583/b319583.txt">Table of n, a(n) for n = 1..10000</a>
%e A319583 255 is 11111111 in binary, 3333 in quaternary and FF in hexadecimal. Hence 255 is in the sequence.
%e A319583 Although 21 is 10101 in binary and 111 in quaternary, it is 15 in hexadecimal and therefore not in the sequence.
%p A319583 extend:= proc(x, d)
%p A319583   local a,b,m;
%p A319583   if d::odd then
%p A319583     m:= (d-1)/2;
%p A319583     a:= x mod 16^(m+1);
%p A319583     b:= floor(x/16^m);
%p A319583     a + 16^(m+1)*b
%p A319583   else
%p A319583     m:= d/2;
%p A319583     a:= x mod 16^m;
%p A319583     b:= floor(x/16^m);
%p A319583     (a + 16^(m+1)*b, a + 16^m * (a mod 16) + 16^(m+1)*b)
%p A319583   fi
%p A319583 end proc:
%p A319583 V:= [1,3,5,15]: R:= 0, op(V):
%p A319583 for d from 1 to 6 do
%p A319583   V:= map(extend,V,d);
%p A319583   R:= R, op(V);
%p A319583 od:
%p A319583 R; # _Robert Israel_, Nov 12 2023
%t A319583 palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
%t A319583 Reap[Do[If[palQ[n, 2] && palQ[n, 4] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* _Jean-François Alcover_, Sep 25 2018 *)
%o A319583 (Sage) [n for n in (0..1000) if Word(n.digits(2)).is_palindrome() and Word(n.digits(4)).is_palindrome() and Word(n.digits(16)).is_palindrome()]
%o A319583 (Magma) [n: n in [0..2*10^7] | Intseq(n, 2) eq Reverse(Intseq(n, 2)) and Intseq(n, 4) eq Reverse(Intseq(n, 4)) and Intseq(n, 16) eq Reverse(Intseq(n, 16))]; // _Vincenzo Librandi_, Sep 24 2018
%Y A319583 Cf. A006995 (base 2), A014192 (base 4), and A029730 (base 16).
%K A319583 nonn,base,look
%O A319583 1,3
%A A319583 _Jeremias M. Gomes_, Sep 23 2018