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!)
A050424 Numbers for which in base 2 the least number of digits that can be removed to leave a palindrome (possibly beginning with 0) is 5. 3
880, 936, 944, 964, 968, 976, 992, 1504, 1744, 1760, 1776, 1840, 1872, 1888, 1924, 1936, 1944, 1952, 1956, 1960, 1968, 1984, 1986, 1988, 1992, 2000, 2016, 2110, 2111, 2142, 2143, 2158, 2159, 2166, 2167, 2206, 2207, 2222, 2223, 2334, 2335, 2784, 2896, 2912 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
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 newb == newb[::-1]: return (digs_to_remove == 5)
return False
print(list(filter(ok, range(2913)))) # Michael S. Branicky, Aug 15 2021
CROSSREFS
Sequence in context: A063051 A190030 A118799 * A206341 A357495 A024393
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Data corrected by Sean A. Irvine, Aug 15 2021
STATUS
approved

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 19 23:15 EDT 2024. Contains 371798 sequences. (Running on oeis4.)