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!)
A050429 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

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 25 07:53 EDT 2024. Contains 371964 sequences. (Running on oeis4.)