%I #19 Nov 10 2024 05:45:59
%S 1,2,3,4,5,9,7,6,8,12,11,15,23,81,18,10,17,30,13,162,27,36,19,24,16,
%T 25,38,46,37,45,31,135,14,20,50,57,47,69,21,55,83,115,419,87,60,210,
%U 61,42,54,26,90,28,29,35,32,63,171,52,59,138,113,180,111,48,88,39,41,621,72,22,953,230,103,207,126,64,33,243
%N Permutation of natural numbers: a(n) = A091205(A245703(n)).
%H Antti Karttunen, <a href="/A245821/b245821.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) = A091205(A245703(n)).
%F Other identities. For all n >= 1, the following holds:
%F A078442(a(n)) = A078442(n), A049076(a(n)) = A049076(n). [Preserves "the order of primeness of n"].
%F a(p_n) = p_{a(n)} where p_n is the n-th prime, A000040(n).
%F a(n) = A049084(a(A000040(n))). [Thus the same permutation is induced also when it is restricted to primes].
%F A245815(n) = A062298(a(A018252(n))). [While restriction to nonprimes induces another permutation].
%o (PARI)
%o allocatemem(234567890);
%o v014580 = vector(2^18);
%o v091226 = vector(2^22);
%o v091242 = 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++; v091242[j] = n; v091226[n] = v091226[n-1]); n++);
%o A014580(n) = v014580[n];
%o A091226(n) = v091226[n];
%o A091242(n) = v091242[n];
%o A091205(n) = if(n<=1, n, if(isA014580(n), prime(A091205(A091226(n))), {my(irfs, t); irfs=subst(lift(factor(Mod(1, 2)*Pol(binary(n)))), x, 2); irfs[,1]=apply(t->A091205(t), irfs[,1]); factorback(irfs)}));
%o A245703(n) = if(1==n, 1, if(isprime(n), A014580(A245703(primepi(n))), A091242(A245703(n-primepi(n)-1))));
%o A245821(n) = A091205(A245703(n));
%o for(n=1, 10001, write("b245821.txt", n, " ", A245821(n)));
%o (Scheme) (define (A245821 n) (A091205 (A245703 n)))
%Y Inverse: A245822.
%Y Other related permutations: A091205, A245703, A245815.
%Y Fixed points: A245823.
%Y Cf. A000040, A049084, A078442, A049076, A018252, A062298.
%K nonn,changed
%O 1,2
%A _Antti Karttunen_, Aug 02 2014