login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A050428 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 4. 3

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

%S 16,48,80,88,104,112,144,152,156,184,200,228,232,240,272,280,284,286,

%T 296,300,302,316,328,336,344,348,376,392,420,424,432,440,452,466,468,

%U 472,482,484,488,496,528,536,540,542,543,552,556,558,559,564,566,574,606

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

%e (64 base 2) = 10000 -> 1.

%o (Python)

%o from itertools import combinations

%o def ok(n):

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

%o for digs_to_remove in range(5):

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

%o return False

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

%Y Cf. A050423, A050425, A050426, A050427, A050429.

%K nonn,base

%O 1,1

%A _Clark Kimberling_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)