A265902 Self-inverse permutation of nonnegative integers: a(n) = A263273(A263272(A263273(n))).
0, 1, 2, 3, 4, 19, 6, 7, 8, 9, 10, 55, 12, 13, 58, 57, 64, 73, 18, 5, 20, 21, 22, 25, 24, 23, 26, 27, 28, 163, 30, 37, 172, 165, 190, 217, 36, 31, 166, 39, 40, 175, 174, 193, 220, 171, 46, 181, 192, 199, 226, 219, 208, 235, 54, 11, 56, 15, 14, 59, 60, 65, 74, 63, 16, 61, 66, 67, 76, 75, 70
Offset: 0
Links
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]]]; t = Table[f[2 n]/2, {n, 0, 1000}]; Table[f[t[[f@ n + 1]]], {n, 0, 83}] (* Michael De Vlieger, Jan 04 2016, after Jean-François Alcover at A263273 *)
-
Scheme
(define (A265902 n) (A263273 (A263272 (A263273 n))))