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.
%I A264996 #10 Jan 09 2016 14:25:30 %S A264996 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, %T A264996 40,15,17,33,24,23,30,21,35,39,18,26,36,27,41,82,55,83,109,46,56,100, %U A264996 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 %N A264996 Self-inverse permutation of natural numbers: a(n) = (1/2) * (1+A263273(2n -1)) = 1 + A264985(n-1). %H A264996 Antti Karttunen, <a href="/A264996/b264996.txt">Table of n, a(n) for n = 1..6561</a> %H A264996 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A264996 a(n) = (1/2) * (1+A263273((2*n)-1)). %F A264996 a(n) = 1 + A264985(n-1). %t A264996 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 *) %o A264996 (Scheme, two alternatives) %o A264996 (define (A264996 n) (/ (+ 1 (A263273 (+ n n -1))) 2)) %o A264996 (define (A264996 n) (+ 1 (A264985 (- n 1)))) %Y A264996 Cf. A263273, A264985. %Y A264996 Cf. also A266401, A266403, A266415, A266416. %K A264996 nonn,base %O A264996 1,2 %A A264996 _Antti Karttunen_, Jan 04 2016