login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers for which in base 2 the least number of digits that can be removed to leave a base 2 palindromic number (beginning with 1) is 5.
4

%I #9 Aug 17 2021 02:40:35

%S 32,96,160,176,208,224,288,304,312,368,400,456,464,480,544,560,568,

%T 572,592,600,604,632,656,672,688,696,752,784,840,848,864,880,904,932,

%U 936,944,964,968,976,992,1056,1072,1080,1084,1086,1104,1112,1116,1118,1128

%N Numbers for which in base 2 the least number of digits that can be removed to leave a base 2 palindromic number (beginning with 1) is 5.

%o (Python)

%o from itertools import combinations

%o def ok(n):

%o b = bin(n)[2:]

%o for digs_to_remove in range(6):

%o for skip in combinations(range(len(b)), digs_to_remove):

%o newb = "".join(b[i] for i in range(len(b)) if i not in skip)

%o if len(newb) > 0 and newb[0] == '1' and newb == newb[::-1]:

%o return (digs_to_remove == 5)

%o return False

%o print(list(filter(ok, range(1129)))) # _Michael S. Branicky_, Aug 15 2021

%K nonn,base

%O 1,1

%A _Clark Kimberling_

%E Data corrected and extended by _Sean A. Irvine_, Aug 15 2021