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”).

A050425
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 1.
4
2, 6, 10, 11, 13, 14, 18, 19, 23, 25, 29, 30, 34, 35, 37, 41, 42, 43, 47, 49, 53, 54, 55, 59, 61, 62, 66, 67, 69, 77, 81, 83, 89, 90, 91, 95, 97, 101, 102, 103, 109, 111, 115, 123, 125, 126, 130, 131, 133, 137, 145, 146, 147, 149, 157, 161, 163, 169, 170, 171
OFFSET
1,1
EXAMPLE
(13 base 2) = 1101 -> 111.
PROG
(Python)
def ok(n):
b = bin(n)[2:]
if b == b[::-1]: return False
for skip in range(len(b)):
newb = b[:skip] + b[skip+1:]
if len(newb) > 0 and newb[0] == '1' and newb == newb[::-1]:
return True
return False
print(list(filter(ok, range(172)))) # Michael S. Branicky, Aug 24 2021
CROSSREFS
Subsequence of A050420 (possibly beginning with digit 0).
Sequence in context: A337645 A225271 A357725 * A030405 A125241 A116043
KEYWORD
nonn,base
STATUS
approved