login
A154810
Nonpalindromic numbers with binary digits only.
2
10, 100, 110, 1000, 1010, 1011, 1100, 1101, 1110, 10000, 10010, 10011, 10100, 10110, 10111, 11000, 11001, 11010, 11100, 11101, 11110, 100000, 100010, 100011, 100100, 100101, 100110, 100111, 101000, 101001, 101010, 101011, 101100, 101110, 101111
OFFSET
1,1
COMMENTS
A154809 written in base 2.
FORMULA
a(n) = A007088(A154809(n)). - Michel Marcus, Jul 24 2024
MATHEMATICA
Map[FromDigits, Select[IntegerDigits[Range[50], 2], !PalindromeQ[#] &]] (* Paolo Xausa, Jul 24 2024 *)
PROG
(Python)
def A154810(n):
def f(x): return n+(x>>(l:=x.bit_length())-(k:=l+1>>1))-(int(bin(x)[k+1:1:-1], 2)>(x&(1<<k)-1))+(1<<k-1+(l&1^1))-1
m, k = n, f(n)
while m != k:
m, k = k, f(k)
return int(bin(m)[2:]) # Chai Wah Wu, Jul 24 2024
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Omar E. Pol, Jan 24 2009
EXTENSIONS
Extended by Ray Chandler, Mar 14 2010
STATUS
approved