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!)
A050420 Numbers for which in base 2 the least number of digits that can be removed to leave a palindrome (possibly beginning with 0) is 1. 4
2, 4, 6, 8, 10, 11, 13, 14, 16, 18, 19, 22, 23, 25, 29, 30, 32, 34, 35, 36, 37, 41, 42, 43, 46, 47, 49, 53, 54, 55, 59, 61, 62, 64, 66, 67, 69, 76, 77, 81, 82, 83, 89, 90, 91, 94, 95, 97, 101, 102, 103, 109, 111, 115, 123, 125, 126, 128, 130, 131, 133, 136 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
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
Includes A164302.
Supersequence of A050425 (beginning with 1).
Sequence in context: A067030 A072427 A337430 * A214671 A291171 A334614
KEYWORD
nonn,base
AUTHOR
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 March 29 02:23 EDT 2024. Contains 371264 sequences. (Running on oeis4.)