login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A117303
Self-inverse permutation of the natural numbers based on the bijection (2*x-1)*2^(y-1) <--> (2*y-1)*2^(x-1).
9
1, 3, 2, 5, 4, 6, 8, 7, 16, 12, 32, 10, 64, 24, 128, 9, 256, 48, 512, 20, 1024, 96, 2048, 14, 4096, 192, 8192, 40, 16384, 384, 32768, 11, 65536, 768, 131072, 80, 262144, 1536, 524288, 28, 1048576, 3072, 2097152, 160, 4194304, 6144, 8388608, 18, 16777216
OFFSET
1,2
COMMENTS
a(a(n)) = n; fixed points A014480: a(A014480(n)) = A014480(n). - Reinhard Zumkeller, Apr 27 2006
FORMULA
a(n) = (2*A001511(n) - 1) * 2^(A003602(n) - 1).
MAPLE
a:= n-> (j-> (2*j+1)*2^((n/2^j-1)/2))(padic[ordp](n, 2)):
seq(a(n), n=1..50); # Alois P. Heinz, Jan 23 2019
MATHEMATICA
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 *)
PROG
(Python)
def A117303(n): return (((m:=(n&-n).bit_length())<<1)-1)*(1<<(n>>m)) # Chai Wah Wu, Jul 14 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Apr 24 2006
EXTENSIONS
Spelling corrected by Jason G. Wurtzel, Aug 23 2010
STATUS
approved