%I #19 Jul 14 2022 09:08:06
%S 1,3,2,5,4,6,8,7,16,12,32,10,64,24,128,9,256,48,512,20,1024,96,2048,
%T 14,4096,192,8192,40,16384,384,32768,11,65536,768,131072,80,262144,
%U 1536,524288,28,1048576,3072,2097152,160,4194304,6144,8388608,18,16777216
%N Self-inverse permutation of the natural numbers based on the bijection (2*x-1)*2^(y-1) <--> (2*y-1)*2^(x-1).
%C a(a(n)) = n; fixed points A014480: a(A014480(n)) = A014480(n). - _Reinhard Zumkeller_, Apr 27 2006
%H Alois P. Heinz, <a href="/A117303/b117303.txt">Table of n, a(n) for n = 1..6644</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(n) = (2*A001511(n) - 1) * 2^(A003602(n) - 1).
%p a:= n-> (j-> (2*j+1)*2^((n/2^j-1)/2))(padic[ordp](n, 2)):
%p seq(a(n), n=1..50); # _Alois P. Heinz_, Jan 23 2019
%t a[n_] := (2 IntegerExponent[2 n, 2] - 1)*2^((n/2^IntegerExponent[n, 2] + 1)/2 - 1); Array[a, 50] (* _Jean-François Alcover_, Mar 12 2019 *)
%o (Python)
%o def A117303(n): return (((m:=(n&-n).bit_length())<<1)-1)*(1<<(n>>m)) # _Chai Wah Wu_, Jul 14 2022
%Y Cf. A000265, A007814, A006519, A005408, A000079.
%Y Cf. A118413, A118416.
%K nonn
%O 1,2
%A _Reinhard Zumkeller_, Apr 24 2006
%E Spelling corrected by _Jason G. Wurtzel_, Aug 23 2010