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 2.
4

%I #7 Aug 24 2021 07:00:34

%S 4,12,20,22,26,28,36,38,39,46,50,57,58,60,68,70,71,74,75,79,82,84,86,

%T 87,94,98,105,106,108,110,113,117,118,121,122,124,132,134,135,138,139,

%U 141,154,155,159,162,166,167,175,177,178,179,180,182,190,194,202

%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 2.

%e (70 base 2) = 1000110 -> 10001.

%o (Python)

%o from itertools import combinations

%o def ok(n):

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

%o for digs_to_remove in range(4):

%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 == 2)

%o return False

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

%Y Cf. A050421, A050425, A050427, A050428, A050429.

%K nonn,base

%O 1,1

%A _Clark Kimberling_