%I #9 Aug 18 2014 00:52:14
%S 1,2,4,5,3,9,8,16,6,11,7,21,22,39,18,15,29,10,34,13,24,33,76,38,14,48,
%T 42,44,46,81,20,19,37,54,32,92,60,23,63,71,25,99,28,233,30,50,98,70,
%U 157,17,79,31,89,49,101,191,86,91,12,161,94,171,193,56,167,43,143,41,353,58,75,78,113,102,68,190,125,67,119,47,130,72,146,52,27
%N Permutation of natural numbers induced when A091204 is restricted to nonprime numbers: a(n) = 1+A091245(A091204(A018252(n))).
%H Antti Karttunen, <a href="/A245814/b245814.txt">Table of n, a(n) for n = 1..10001</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(n) = 1 + A091245(A091204(A018252(n))).
%F As a composition of related permutations:
%F a(n) = A245819(A245816(n)).
%o (PARI)
%o allocatemem(123456789);
%o v014580 = vector(2^18);
%o v091226 = vector(2^22);
%o isA014580(n)=polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from _Charles R Greathouse IV_
%o i=0; j=0; n=2; while((n < 2^22), if(isA014580(n), i++; v014580[i] = n; v091226[n] = v091226[n-1]+1, j++; v091226[n] = v091226[n-1]); n++);
%o A002808(n)={my(k); for(k=0, primepi(n), isprime(n++)&&k--); n}; \\ This function from _M. F. Hasler_
%o A018252(n) = if(1==n, 1, A002808(n-1));
%o A014580(n) = v014580[n];
%o A091226(n) = v091226[n];
%o A091245(n) = ((n-A091226(n))-1);
%o A091204(n) = if(n<=1, n, if(isprime(n), A014580(A091204(primepi(n))), {my(pfs, t, bits, i); pfs=factor(n); pfs[, 1]=apply(t->Pol(binary(A091204(t))), pfs[, 1]); sum(i=1, #bits=Vec(factorback(pfs))%2, bits[i]<<(#bits-i))}));
%o A245814(n) = 1 + A091245(A091204(A018252(n)))
%o for(n=1, 10001, write("b245814.txt", n, " ", A245814(n)));
%o (Scheme) (define (A245814 n) (+ 1 (A091245 (A091204 (A018252 n)))))
%Y Inverse: A245813.
%Y Related permutations: A091204, A245816, A245819.
%Y Cf. A018252, A091245.
%K nonn
%O 1,2
%A _Antti Karttunen_, Aug 16 2014