%I #8 Aug 27 2014 14:53:42
%S 1,2,4,3,8,5,7,9,6,17,19,11,39,35,25,15,16,13,23,33,29,37,75,27,95,87,
%T 61,55,767,45,83,67,10,21,47,71,159,143,139,51,319,175,639,287,251,
%U 263,247,135,527,239,199,447,105,115,991,119,1015,443,4575,85,583,2175,1343,151,12,31,63,69,131,77
%N Permutation of natural numbers: a(n) = A135141(A005940(n)).
%C Even terms occur at the positions 2^n + 1 (A000051), in some order, and the odd terms everywhere else.
%H Antti Karttunen, <a href="/A246365/b246365.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(n) = A135141(A005940(n)).
%o (PARI)
%o default(primelimit,(2^31)+(2^30));
%o A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ Modified from code of _M. F. Hasler_
%o A135141(n) = if(1==n, 1, if(isprime(n), 2*A135141(primepi(n)), 1+(2*A135141(n-primepi(n)-1))));
%o A246365(n) = A135141(A005940(n));
%o for(n=1, 10000, write("b246365.txt", n, " ", A246365(n)));
%o (Scheme) (define (A246365 n) (A135141 (A005940 n)))
%Y Inverse: A246366.
%Y Related or similar permutations: A005940, A135141, A246363, A246367.
%Y Cf. A000051, A003961.
%K nonn
%O 1,2
%A _Antti Karttunen_, Aug 26 2014