|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|