OFFSET
1,2
COMMENTS
This is a self-inverse permutation of the positive integers.
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 1..10000
EXAMPLE
18 in binary is 10010. The inner digits are 001. Reverse these, leaving the first digit (a 1) and the last digit (a 0) untouched, and we have 11000. a(18) is the decimal equivalent of 11000, which is 24.
MATHEMATICA
a[n_]:=FromDigits[Append[Join[{Part[IntegerDigits[n, 2], 1]}, Reverse[Drop[Drop[IntegerDigits[n, 2], 1], -1]]], Part[IntegerDigits[n, 2], -1]], 2]; Join[{1}, Array[a, 71, 2]] (* Stefano Spezia, Jan 14 2023 *)
CROSSREFS
KEYWORD
AUTHOR
Leroy Quet, Aug 04 2009
EXTENSIONS
More terms from R. J. Mathar, Sep 27 2009
STATUS
approved