OFFSET
1,2
COMMENTS
A permutation of the natural numbers.
LINKS
FORMULA
a(1) = 1, a(2^k + j) = 2^k + a(2^k - j + 1) for 1 <= j <= 2^k.
As a composition of related permutations:
MATHEMATICA
Nest[Join[#, Length[#]+Reverse[#]]&, {1}, 7] (* Vladimir Joseph Stephan Orlovsky, Feb 01 2012 *)
PROG
(Python)
def A105081(n): return 1+(n-1^ n-1>>1) # Chai Wah Wu, Jun 29 2022
CROSSREFS
KEYWORD
AUTHOR
Philippe Deléham, Apr 28 2005
STATUS
approved