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