OFFSET
1,1
PROG
(Python)
from itertools import combinations
def ok(n):
b = bin(n)[2:]
for digs_to_remove in range(6):
for skip in combinations(range(len(b)), digs_to_remove):
newb = "".join(b[i] for i in range(len(b)) if i not in skip)
if len(newb) > 0 and newb[0] == '1' and newb == newb[::-1]:
return (digs_to_remove == 5)
return False
print(list(filter(ok, range(1129)))) # Michael S. Branicky, Aug 15 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Data corrected and extended by Sean A. Irvine, Aug 15 2021
STATUS
approved