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.

A264996 Self-inverse permutation of natural numbers: a(n) = (1/2) * (1+A263273(2n -1)) = 1 + A264985(n-1).

Original entry on oeis.org

1, 2, 4, 3, 5, 10, 7, 11, 13, 6, 8, 12, 9, 14, 28, 19, 29, 37, 16, 20, 34, 25, 32, 31, 22, 38, 40, 15, 17, 33, 24, 23, 30, 21, 35, 39, 18, 26, 36, 27, 41, 82, 55, 83, 109, 46, 56, 100, 73, 86, 91, 64, 110, 118, 43, 47, 97, 70, 59, 88, 61, 101, 115, 52, 74, 106, 79, 95, 85, 58, 92, 112, 49, 65, 103, 76
Offset: 1

Views

Author

Antti Karttunen, Jan 04 2016

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{g, h}, g[x_] := x/3^IntegerExponent[x, 3]; h[x_] := x/g@ x; If[n == 0, 0, FromDigits[Reverse@ IntegerDigits[#, 3], 3] &@ g[n] h[n]]]; Array[(1/2) (1 + f[2 # - 1]) &, {76}] (* Michael De Vlieger, Jan 04 2016, after Jean-François Alcover at A263273 *)

Formula

a(n) = (1/2) * (1+A263273((2*n)-1)).
a(n) = 1 + A264985(n-1).