%I #10 Mar 25 2016 07:46:53
%S 1,2,3,4,5,6,7,8,11,10,9,12,15,14,19,16,13,22,31,20,27,18,21,24,63,30,
%T 23,28,17,38,43,32,35,26,29,44,39,62,87,40,37,54,79,36,75,42,25,48,
%U 159,126,127,60,61,46,51,56,55,34,53,76,123,86,107,64,41,70,71,52,247,58,125,88,143,78,251,124,45,174,59,80,287,74,33
%N Permutation of natural numbers: a(1) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064216(n)).
%H Antti Karttunen, <a href="/A269853/b269853.txt">Table of n, a(n) for n = 1..8192</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(1) = 1, after which for even n, a(n) = 2*a(n/2), for odd n, a(n) = 1 + 2*a(A064989(n-2)).
%t a[1] = 1; a[n_] := a[n] = If[EvenQ@ n, 2 a[n/2], 1 + 2 a[Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[(n - 1) - 1]]]; Table[a@ n, {n, 83}] (* _Michael De Vlieger_, Mar 23 2016 *)
%o (Scheme, with memoization-macro definec)
%o (definec (A269853 n) (cond ((= 1 n) n) ((even? n) (* 2 (A269853 (/ n 2)))) (else (+ 1 (* 2 (A269853 (A064216 (/ (- n 1) 2))))))))
%Y Inverse: A269854.
%Y Cf. A003961, A064216, A064989, A243071, A246376.
%K nonn
%O 1,2
%A _Antti Karttunen_, Mar 16 2016