OFFSET
0,3
COMMENTS
In other words, keep the trailing zeros in the binary expansion of n fixed, but reverse all the digits up to that point. - N. J. A. Sloane, May 30 2016
A permutation of integers consisting only of fixed points and pairs. a(n)=n when n is a binary palindrome (including as many leading as trailing zeros), otherwise a(n)=A003010(n) (i.e. n has no axis of symmetry). A057890 gives the palindromes (fixed points, akin to A006995) while A057891 gives the "antidromes" (pairs).
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 0..16384, May 30 2016 [First 8192 terms from Ivan Neretin, Jul 09 2015]
EXAMPLE
a(6)=6 because 0110 is a palindrome, but a(11)=13 because 1011 reverses into 1101.
MATHEMATICA
Table[FromDigits[Reverse[IntegerDigits[n, 2]], 2]*2^IntegerExponent[n, 2], {n, 71}] (* Ivan Neretin, Jul 09 2015 *)
PROG
(Python)
def a(n):
x = bin(n)[2:]
y = x[::-1]
return int(str(int(y))+(len(x) - len(str(int(y))))*'0', 2)
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 11 2017
CROSSREFS
KEYWORD
AUTHOR
Marc LeBrun, Sep 25 2000
STATUS
approved