OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
(18 base 2) = 10010 -> 1001.
MAPLE
filter:= proc(n) local L, R, k, m;
L:= convert(n, base, 2);
R:= ListTools:-Reverse(L);
m:= nops(L);
if L = R then return false fi;
ormap(i -> subsop(i=NULL, L)=subsop(m+1-i=NULL, R), [$1..m]);
end proc:
select(filter, [$1..200]); # Robert Israel, Oct 28 2020
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 == newb[::-1]:
return True
return False
print(list(filter(ok, range(137)))) # Michael S. Branicky, Aug 24 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved