cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A117303 Self-inverse permutation of the natural numbers based on the bijection (2*x-1)*2^(y-1) <--> (2*y-1)*2^(x-1).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Apr 24 2006

Keywords

Comments

a(a(n)) = n; fixed points A014480: a(A014480(n)) = A014480(n). - Reinhard Zumkeller, Apr 27 2006

Crossrefs

Programs

  • 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 *)
  • Python
    def A117303(n): return (((m:=(n&-n).bit_length())<<1)-1)*(1<<(n>>m)) # Chai Wah Wu, Jul 14 2022

Formula

a(n) = (2*A001511(n) - 1) * 2^(A003602(n) - 1).

Extensions

Spelling corrected by Jason G. Wurtzel, Aug 23 2010